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

com.azure.resourcemanager.machinelearning.implementation.RegistryCodeContainersImpl 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.RegistryCodeContainersClient;
import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner;
import com.azure.resourcemanager.machinelearning.models.CodeContainer;
import com.azure.resourcemanager.machinelearning.models.RegistryCodeContainers;

public final class RegistryCodeContainersImpl implements RegistryCodeContainers {
    private static final ClientLogger LOGGER = new ClientLogger(RegistryCodeContainersImpl.class);

    private final RegistryCodeContainersClient innerClient;

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

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

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

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

    public void delete(String resourceGroupName, String registryName, String codeName) {
        this.serviceClient().delete(resourceGroupName, registryName, codeName);
    }

    public void delete(String resourceGroupName, String registryName, String codeName, Context context) {
        this.serviceClient().delete(resourceGroupName, registryName, codeName, context);
    }

    public Response getWithResponse(String resourceGroupName, String registryName, String codeName,
        Context context) {
        Response inner
            = this.serviceClient().getWithResponse(resourceGroupName, registryName, codeName, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new CodeContainerImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public CodeContainer get(String resourceGroupName, String registryName, String codeName) {
        CodeContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, codeName);
        if (inner != null) {
            return new CodeContainerImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public CodeContainer createOrUpdate(String resourceGroupName, String registryName, String codeName,
        CodeContainerInner body) {
        CodeContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, registryName, codeName, body);
        if (inner != null) {
            return new CodeContainerImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public CodeContainer createOrUpdate(String resourceGroupName, String registryName, String codeName,
        CodeContainerInner body, Context context) {
        CodeContainerInner inner
            = this.serviceClient().createOrUpdate(resourceGroupName, registryName, codeName, body, context);
        if (inner != null) {
            return new CodeContainerImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy