@azure/arm-automation
Version:
AutomationClient Library with typescript type definitions for node.js and browser.
88 lines (82 loc) • 3.35 kB
text/typescript
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/keysMappers";
import * as Parameters from "../models/parameters";
import { AutomationClientContext } from "../automationClientContext";
/** Class representing a Keys. */
export class Keys {
private readonly client: AutomationClientContext;
/**
* Create a Keys.
* @param {AutomationClientContext} client Reference to the service client.
*/
constructor(client: AutomationClientContext) {
this.client = client;
}
/**
* Retrieve the automation keys for an account.
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param [options] The optional parameters
* @returns Promise<Models.KeysListByAutomationAccountResponse>
*/
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: msRest.RequestOptionsBase): Promise<Models.KeysListByAutomationAccountResponse>;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param callback The callback
*/
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: msRest.ServiceCallback<Models.KeyListResult>): void;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param options The optional parameters
* @param callback The callback
*/
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.KeyListResult>): void;
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.KeyListResult>, callback?: msRest.ServiceCallback<Models.KeyListResult>): Promise<Models.KeysListByAutomationAccountResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
automationAccountName,
options
},
listByAutomationAccountOperationSpec,
callback) as Promise<Models.KeysListByAutomationAccountResponse>;
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const listByAutomationAccountOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys",
urlParameters: [
Parameters.resourceGroupName,
Parameters.automationAccountName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion0
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.KeyListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};