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

com.azure.resourcemanager.automation.implementation.KeysImpl 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-2022-02-22.

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.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.KeysClient;
import com.azure.resourcemanager.automation.fluent.models.KeyListResultInner;
import com.azure.resourcemanager.automation.models.KeyListResult;
import com.azure.resourcemanager.automation.models.Keys;

public final class KeysImpl implements Keys {
    private static final ClientLogger LOGGER = new ClientLogger(KeysImpl.class);

    private final KeysClient innerClient;

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

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

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

    public KeyListResult listByAutomationAccount(String resourceGroupName, String automationAccountName) {
        KeyListResultInner inner
            = this.serviceClient().listByAutomationAccount(resourceGroupName, automationAccountName);
        if (inner != null) {
            return new KeyListResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy