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

com.azure.resourcemanager.automation.implementation.DscNodesImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2019-06.

There is a newer version: 1.0.0
Show 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.automation.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.automation.fluent.DscNodesClient;
import com.azure.resourcemanager.automation.fluent.models.DscNodeInner;
import com.azure.resourcemanager.automation.models.DscNode;
import com.azure.resourcemanager.automation.models.DscNodeUpdateParameters;
import com.azure.resourcemanager.automation.models.DscNodes;
import com.fasterxml.jackson.annotation.JsonIgnore;

public final class DscNodesImpl implements DscNodes {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(DscNodesImpl.class);

    private final DscNodesClient innerClient;

    private final com.azure.resourcemanager.automation.AutomationManager serviceManager;

    public DscNodesImpl(
        DscNodesClient innerClient, com.azure.resourcemanager.automation.AutomationManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public void delete(String resourceGroupName, String automationAccountName, String nodeId) {
        this.serviceClient().delete(resourceGroupName, automationAccountName, nodeId);
    }

    public Response deleteWithResponse(
        String resourceGroupName, String automationAccountName, String nodeId, Context context) {
        return this.serviceClient().deleteWithResponse(resourceGroupName, automationAccountName, nodeId, context);
    }

    public DscNode get(String resourceGroupName, String automationAccountName, String nodeId) {
        DscNodeInner inner = this.serviceClient().get(resourceGroupName, automationAccountName, nodeId);
        if (inner != null) {
            return new DscNodeImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    public DscNode update(
        String resourceGroupName,
        String automationAccountName,
        String nodeId,
        DscNodeUpdateParameters dscNodeUpdateParameters) {
        DscNodeInner inner =
            this.serviceClient().update(resourceGroupName, automationAccountName, nodeId, dscNodeUpdateParameters);
        if (inner != null) {
            return new DscNodeImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response updateWithResponse(
        String resourceGroupName,
        String automationAccountName,
        String nodeId,
        DscNodeUpdateParameters dscNodeUpdateParameters,
        Context context) {
        Response inner =
            this
                .serviceClient()
                .updateWithResponse(resourceGroupName, automationAccountName, nodeId, dscNodeUpdateParameters, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new DscNodeImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public PagedIterable listByAutomationAccount(String resourceGroupName, String automationAccountName) {
        PagedIterable inner =
            this.serviceClient().listByAutomationAccount(resourceGroupName, automationAccountName);
        return Utils.mapPage(inner, inner1 -> new DscNodeImpl(inner1, this.manager()));
    }

    public PagedIterable listByAutomationAccount(
        String resourceGroupName,
        String automationAccountName,
        String filter,
        Integer skip,
        Integer top,
        String inlinecount,
        Context context) {
        PagedIterable inner =
            this
                .serviceClient()
                .listByAutomationAccount(
                    resourceGroupName, automationAccountName, filter, skip, top, inlinecount, context);
        return Utils.mapPage(inner, inner1 -> new DscNodeImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.automation.AutomationManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy