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

com.azure.resourcemanager.automation.implementation.HybridRunbookWorkerGroupsImpl 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.HybridRunbookWorkerGroupsClient;
import com.azure.resourcemanager.automation.fluent.models.HybridRunbookWorkerGroupInner;
import com.azure.resourcemanager.automation.models.HybridRunbookWorkerGroup;
import com.azure.resourcemanager.automation.models.HybridRunbookWorkerGroupUpdateParameters;
import com.azure.resourcemanager.automation.models.HybridRunbookWorkerGroups;
import com.fasterxml.jackson.annotation.JsonIgnore;

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

    private final HybridRunbookWorkerGroupsClient innerClient;

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

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

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

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

    public HybridRunbookWorkerGroup get(
        String resourceGroupName, String automationAccountName, String hybridRunbookWorkerGroupName) {
        HybridRunbookWorkerGroupInner inner =
            this.serviceClient().get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName);
        if (inner != null) {
            return new HybridRunbookWorkerGroupImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    public HybridRunbookWorkerGroup update(
        String resourceGroupName,
        String automationAccountName,
        String hybridRunbookWorkerGroupName,
        HybridRunbookWorkerGroupUpdateParameters parameters) {
        HybridRunbookWorkerGroupInner inner =
            this
                .serviceClient()
                .update(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters);
        if (inner != null) {
            return new HybridRunbookWorkerGroupImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response updateWithResponse(
        String resourceGroupName,
        String automationAccountName,
        String hybridRunbookWorkerGroupName,
        HybridRunbookWorkerGroupUpdateParameters parameters,
        Context context) {
        Response inner =
            this
                .serviceClient()
                .updateWithResponse(
                    resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new HybridRunbookWorkerGroupImpl(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 HybridRunbookWorkerGroupImpl(inner1, this.manager()));
    }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy