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

com.azure.resourcemanager.automation.implementation.RunbookDraftsImpl 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.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.RunbookDraftsClient;
import com.azure.resourcemanager.automation.fluent.models.RunbookDraftInner;
import com.azure.resourcemanager.automation.models.RunbookDraft;
import com.azure.resourcemanager.automation.models.RunbookDrafts;
import com.fasterxml.jackson.annotation.JsonIgnore;

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

    private final RunbookDraftsClient innerClient;

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

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

    public String getContent(String resourceGroupName, String automationAccountName, String runbookName) {
        return this.serviceClient().getContent(resourceGroupName, automationAccountName, runbookName);
    }

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

    public void replaceContent(
        String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) {
        this.serviceClient().replaceContent(resourceGroupName, automationAccountName, runbookName, runbookContent);
    }

    public void replaceContent(
        String resourceGroupName,
        String automationAccountName,
        String runbookName,
        String runbookContent,
        Context context) {
        this
            .serviceClient()
            .replaceContent(resourceGroupName, automationAccountName, runbookName, runbookContent, context);
    }

    public RunbookDraft get(String resourceGroupName, String automationAccountName, String runbookName) {
        RunbookDraftInner inner = this.serviceClient().get(resourceGroupName, automationAccountName, runbookName);
        if (inner != null) {
            return new RunbookDraftImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    public void undoEdit(String resourceGroupName, String automationAccountName, String runbookName) {
        this.serviceClient().undoEdit(resourceGroupName, automationAccountName, runbookName);
    }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy