UNPKG

@azure/arm-automation

Version:

AutomationClient Library with typescript type definitions for node.js and browser.

339 lines (325 loc) 14.3 kB
/* * 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/connectionTypeOperationsMappers"; import * as Parameters from "../models/parameters"; import { AutomationClientContext } from "../automationClientContext"; /** Class representing a ConnectionTypeOperations. */ export class ConnectionTypeOperations { private readonly client: AutomationClientContext; /** * Create a ConnectionTypeOperations. * @param {AutomationClientContext} client Reference to the service client. */ constructor(client: AutomationClientContext) { this.client = client; } /** * Delete the connection type. * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The name of connection type. * @param [options] The optional parameters * @returns Promise<msRest.RestResponse> */ deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>; /** * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The name of connection type. * @param callback The callback */ deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, callback: msRest.ServiceCallback<void>): void; /** * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The name of connection type. * @param options The optional parameters * @param callback The callback */ deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void; deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> { return this.client.sendOperationRequest( { resourceGroupName, automationAccountName, connectionTypeName, options }, deleteMethodOperationSpec, callback); } /** * Retrieve the connection type identified by connection type name. * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The name of connection type. * @param [options] The optional parameters * @returns Promise<Models.ConnectionTypeGetResponse> */ get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: msRest.RequestOptionsBase): Promise<Models.ConnectionTypeGetResponse>; /** * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The name of connection type. * @param callback The callback */ get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, callback: msRest.ServiceCallback<Models.ConnectionType>): void; /** * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The name of connection type. * @param options The optional parameters * @param callback The callback */ get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ConnectionType>): void; get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ConnectionType>, callback?: msRest.ServiceCallback<Models.ConnectionType>): Promise<Models.ConnectionTypeGetResponse> { return this.client.sendOperationRequest( { resourceGroupName, automationAccountName, connectionTypeName, options }, getOperationSpec, callback) as Promise<Models.ConnectionTypeGetResponse>; } /** * Create a connection type. * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The parameters supplied to the create or update connection type * operation. * @param parameters The parameters supplied to the create or update connection type operation. * @param [options] The optional parameters * @returns Promise<Models.ConnectionTypeCreateOrUpdateResponse> */ createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: Models.ConnectionTypeCreateOrUpdateParameters, options?: msRest.RequestOptionsBase): Promise<Models.ConnectionTypeCreateOrUpdateResponse>; /** * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The parameters supplied to the create or update connection type * operation. * @param parameters The parameters supplied to the create or update connection type operation. * @param callback The callback */ createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: Models.ConnectionTypeCreateOrUpdateParameters, callback: msRest.ServiceCallback<Models.ConnectionType>): void; /** * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param connectionTypeName The parameters supplied to the create or update connection type * operation. * @param parameters The parameters supplied to the create or update connection type operation. * @param options The optional parameters * @param callback The callback */ createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: Models.ConnectionTypeCreateOrUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ConnectionType>): void; createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: Models.ConnectionTypeCreateOrUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ConnectionType>, callback?: msRest.ServiceCallback<Models.ConnectionType>): Promise<Models.ConnectionTypeCreateOrUpdateResponse> { return this.client.sendOperationRequest( { resourceGroupName, automationAccountName, connectionTypeName, parameters, options }, createOrUpdateOperationSpec, callback) as Promise<Models.ConnectionTypeCreateOrUpdateResponse>; } /** * Retrieve a list of connection types. * @param resourceGroupName Name of an Azure Resource group. * @param automationAccountName The name of the automation account. * @param [options] The optional parameters * @returns Promise<Models.ConnectionTypeListByAutomationAccountResponse> */ listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: msRest.RequestOptionsBase): Promise<Models.ConnectionTypeListByAutomationAccountResponse>; /** * @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.ConnectionTypeListResult>): 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.ConnectionTypeListResult>): void; listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ConnectionTypeListResult>, callback?: msRest.ServiceCallback<Models.ConnectionTypeListResult>): Promise<Models.ConnectionTypeListByAutomationAccountResponse> { return this.client.sendOperationRequest( { resourceGroupName, automationAccountName, options }, listByAutomationAccountOperationSpec, callback) as Promise<Models.ConnectionTypeListByAutomationAccountResponse>; } /** * Retrieve a list of connection types. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise<Models.ConnectionTypeListByAutomationAccountNextResponse> */ listByAutomationAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ConnectionTypeListByAutomationAccountNextResponse>; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ listByAutomationAccountNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.ConnectionTypeListResult>): void; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param options The optional parameters * @param callback The callback */ listByAutomationAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ConnectionTypeListResult>): void; listByAutomationAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ConnectionTypeListResult>, callback?: msRest.ServiceCallback<Models.ConnectionTypeListResult>): Promise<Models.ConnectionTypeListByAutomationAccountNextResponse> { return this.client.sendOperationRequest( { nextPageLink, options }, listByAutomationAccountNextOperationSpec, callback) as Promise<Models.ConnectionTypeListByAutomationAccountNextResponse>; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", urlParameters: [ Parameters.resourceGroupName, Parameters.automationAccountName, Parameters.connectionTypeName, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", urlParameters: [ Parameters.resourceGroupName, Parameters.automationAccountName, Parameters.connectionTypeName, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.ConnectionType }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const createOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", urlParameters: [ Parameters.resourceGroupName, Parameters.automationAccountName, Parameters.connectionTypeName, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], requestBody: { parameterPath: "parameters", mapper: { ...Mappers.ConnectionTypeCreateOrUpdateParameters, required: true } }, responses: { 201: { bodyMapper: Mappers.ConnectionType }, 409: { bodyMapper: Mappers.ConnectionType }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const listByAutomationAccountOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes", urlParameters: [ Parameters.resourceGroupName, Parameters.automationAccountName, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.ConnectionTypeListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const listByAutomationAccountNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", urlParameters: [ Parameters.nextPageLink ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.ConnectionTypeListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer };