All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.machinelearning.implementation.QuotasImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2024-04.

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.machinelearning.implementation;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.machinelearning.fluent.QuotasClient;
import com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner;
import com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner;
import com.azure.resourcemanager.machinelearning.models.Quotas;
import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters;
import com.azure.resourcemanager.machinelearning.models.ResourceQuota;
import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotasResult;

public final class QuotasImpl implements Quotas {
    private static final ClientLogger LOGGER = new ClientLogger(QuotasImpl.class);

    private final QuotasClient innerClient;

    private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager;

    public QuotasImpl(QuotasClient innerClient,
        com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response updateWithResponse(String location, QuotaUpdateParameters parameters,
        Context context) {
        Response inner
            = this.serviceClient().updateWithResponse(location, parameters, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new UpdateWorkspaceQuotasResultImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public UpdateWorkspaceQuotasResult update(String location, QuotaUpdateParameters parameters) {
        UpdateWorkspaceQuotasResultInner inner = this.serviceClient().update(location, parameters);
        if (inner != null) {
            return new UpdateWorkspaceQuotasResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public PagedIterable list(String location) {
        PagedIterable inner = this.serviceClient().list(location);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceQuotaImpl(inner1, this.manager()));
    }

    public PagedIterable list(String location, Context context) {
        PagedIterable inner = this.serviceClient().list(location, context);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceQuotaImpl(inner1, this.manager()));
    }

    private QuotasClient serviceClient() {
        return this.innerClient;
    }

    private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy