/* * 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/virtualMachineExtensionImagesMappers"; import * as Parameters from "../models/parameters"; import { ComputeManagementClientContext } from "../computeManagementClientContext"; /** Class representing a VirtualMachineExtensionImages. */ export class VirtualMachineExtensionImages { private readonly client: ComputeManagementClientContext; /** * Create a VirtualMachineExtensionImages. * @param {ComputeManagementClientContext} client Reference to the service client. */ constructor(client: ComputeManagementClientContext) { this.client = client; } /** * Gets a virtual machine extension image. * @param location The name of a supported Azure region. * @param publisherName * @param type * @param version * @param [options] The optional parameters * @returns Promise */ get(location: string, publisherName: string, type: string, version: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location The name of a supported Azure region. * @param publisherName * @param type * @param version * @param callback The callback */ get(location: string, publisherName: string, type: string, version: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName * @param type * @param version * @param options The optional parameters * @param callback The callback */ get(location: string, publisherName: string, type: string, version: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; get(location: string, publisherName: string, type: string, version: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, type, version, options }, getOperationSpec, callback) as Promise; } /** * Gets a list of virtual machine extension image types. * @param location The name of a supported Azure region. * @param publisherName * @param [options] The optional parameters * @returns Promise */ listTypes(location: string, publisherName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location The name of a supported Azure region. * @param publisherName * @param callback The callback */ listTypes(location: string, publisherName: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName * @param options The optional parameters * @param callback The callback */ listTypes(location: string, publisherName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; listTypes(location: string, publisherName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, options }, listTypesOperationSpec, callback) as Promise; } /** * Gets a list of virtual machine extension image versions. * @param location The name of a supported Azure region. * @param publisherName * @param type * @param [options] The optional parameters * @returns Promise */ listVersions(location: string, publisherName: string, type: string, options?: Models.VirtualMachineExtensionImagesListVersionsOptionalParams): Promise; /** * @param location The name of a supported Azure region. * @param publisherName * @param type * @param callback The callback */ listVersions(location: string, publisherName: string, type: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName * @param type * @param options The optional parameters * @param callback The callback */ listVersions(location: string, publisherName: string, type: string, options: Models.VirtualMachineExtensionImagesListVersionsOptionalParams, callback: msRest.ServiceCallback): void; listVersions(location: string, publisherName: string, type: string, options?: Models.VirtualMachineExtensionImagesListVersionsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, type, options }, listVersionsOperationSpec, callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", urlParameters: [ Parameters.location0, Parameters.publisherName, Parameters.type, Parameters.version, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.VirtualMachineExtensionImage }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const listTypesOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", urlParameters: [ Parameters.location0, Parameters.publisherName, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "VirtualMachineExtensionImage" } } } } }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const listVersionsOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", urlParameters: [ Parameters.location0, Parameters.publisherName, Parameters.type, Parameters.subscriptionId ], queryParameters: [ Parameters.filter, Parameters.top, Parameters.orderby, Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "VirtualMachineExtensionImage" } } } } }, default: { bodyMapper: Mappers.CloudError } }, serializer };