/* * 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/virtualMachineImagesMappers"; import * as Parameters from "../models/parameters"; import { ComputeManagementClientContext } from "../computeManagementClientContext"; /** Class representing a VirtualMachineImages. */ export class VirtualMachineImages { private readonly client: ComputeManagementClientContext; /** * Create a VirtualMachineImages. * @param {ComputeManagementClientContext} client Reference to the service client. */ constructor(client: ComputeManagementClientContext) { this.client = client; } /** * Gets a virtual machine image. * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param skus A valid image SKU. * @param version A valid image SKU version. * @param [options] The optional parameters * @returns Promise */ get(location: string, publisherName: string, offer: string, skus: string, version: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param skus A valid image SKU. * @param version A valid image SKU version. * @param callback The callback */ get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param skus A valid image SKU. * @param version A valid image SKU version. * @param options The optional parameters * @param callback The callback */ get(location: string, publisherName: string, offer: string, skus: string, version: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; get(location: string, publisherName: string, offer: string, skus: string, version: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, offer, skus, version, options }, getOperationSpec, callback) as Promise; } /** * Gets a list of all virtual machine image versions for the specified location, publisher, offer, * and SKU. * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param skus A valid image SKU. * @param [options] The optional parameters * @returns Promise */ list(location: string, publisherName: string, offer: string, skus: string, options?: Models.VirtualMachineImagesListOptionalParams): Promise; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param skus A valid image SKU. * @param callback The callback */ list(location: string, publisherName: string, offer: string, skus: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param skus A valid image SKU. * @param options The optional parameters * @param callback The callback */ list(location: string, publisherName: string, offer: string, skus: string, options: Models.VirtualMachineImagesListOptionalParams, callback: msRest.ServiceCallback): void; list(location: string, publisherName: string, offer: string, skus: string, options?: Models.VirtualMachineImagesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, offer, skus, options }, listOperationSpec, callback) as Promise; } /** * Gets a list of virtual machine image offers for the specified location and publisher. * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param [options] The optional parameters * @returns Promise */ listOffers(location: string, publisherName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param callback The callback */ listOffers(location: string, publisherName: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param options The optional parameters * @param callback The callback */ listOffers(location: string, publisherName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; listOffers(location: string, publisherName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, options }, listOffersOperationSpec, callback) as Promise; } /** * Gets a list of virtual machine image publishers for the specified Azure location. * @param location The name of a supported Azure region. * @param [options] The optional parameters * @returns Promise */ listPublishers(location: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location The name of a supported Azure region. * @param callback The callback */ listPublishers(location: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param options The optional parameters * @param callback The callback */ listPublishers(location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; listPublishers(location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, options }, listPublishersOperationSpec, callback) as Promise; } /** * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param [options] The optional parameters * @returns Promise */ listSkus(location: string, publisherName: string, offer: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param callback The callback */ listSkus(location: string, publisherName: string, offer: string, callback: msRest.ServiceCallback): void; /** * @param location The name of a supported Azure region. * @param publisherName A valid image publisher. * @param offer A valid image publisher offer. * @param options The optional parameters * @param callback The callback */ listSkus(location: string, publisherName: string, offer: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; listSkus(location: string, publisherName: string, offer: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, publisherName, offer, options }, listSkusOperationSpec, 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/vmimage/offers/{offer}/skus/{skus}/versions/{version}", urlParameters: [ Parameters.location0, Parameters.publisherName, Parameters.offer, Parameters.skus, Parameters.version, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.VirtualMachineImage }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", urlParameters: [ Parameters.location0, Parameters.publisherName, Parameters.offer, Parameters.skus, 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: "VirtualMachineImageResource" } } } } }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const listOffersOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", 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: "VirtualMachineImageResource" } } } } }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const listPublishersOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", urlParameters: [ Parameters.location0, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "VirtualMachineImageResource" } } } } }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const listSkusOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", urlParameters: [ Parameters.location0, Parameters.publisherName, Parameters.offer, Parameters.subscriptionId ], queryParameters: [ Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "VirtualMachineImageResource" } } } } }, default: { bodyMapper: Mappers.CloudError } }, serializer };