import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { CloudServiceOperatingSystems } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { ComputeManagementClient } from "../computeManagementClient" ; import { OSVersion , CloudServiceOperatingSystemsListOSVersionsNextOptionalParams , CloudServiceOperatingSystemsListOSVersionsOptionalParams , OSFamily , CloudServiceOperatingSystemsListOSFamiliesNextOptionalParams , CloudServiceOperatingSystemsListOSFamiliesOptionalParams , CloudServiceOperatingSystemsGetOSVersionOptionalParams , CloudServiceOperatingSystemsGetOSVersionResponse , CloudServiceOperatingSystemsListOSVersionsResponse , CloudServiceOperatingSystemsGetOSFamilyOptionalParams , CloudServiceOperatingSystemsGetOSFamilyResponse , CloudServiceOperatingSystemsListOSFamiliesResponse , CloudServiceOperatingSystemsListOSVersionsNextResponse , CloudServiceOperatingSystemsListOSFamiliesNextResponse } from "../models" ; /** Class containing CloudServiceOperatingSystems operations. */ export class CloudServiceOperatingSystemsImpl implements CloudServiceOperatingSystems { private readonly client : ComputeManagementClient ; param client constructor ( client ) { this . client = client ; } param location param options public listOSVersions ( location , options ? ) { const iter = this . listOSVersionsPagingAll ( location , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listOSVersionsPagingPage ( location , options ) ; } } ; } private async * listOSVersionsPagingPage ( location , options ? ) { let result = await this . _listOSVersions ( location , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listOSVersionsNext ( location , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listOSVersionsPagingAll ( location , options ? ) { for await ( const page of this . listOSVersionsPagingPage ( location , options ) ) { yield * page ; } } param location param options public listOSFamilies ( location , options ? ) { const iter = this . listOSFamiliesPagingAll ( location , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listOSFamiliesPagingPage ( location , options ) ; } } ; } private async * listOSFamiliesPagingPage ( location , options ? ) { let result = await this . _listOSFamilies ( location , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listOSFamiliesNext ( location , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listOSFamiliesPagingAll ( location , options ? ) { for await ( const page of this . listOSFamiliesPagingPage ( location , options ) ) { yield * page ; } } param location param osVersionName param options getOSVersion ( location , osVersionName , options ? ) { return this . client . sendOperationRequest ( { location , osVersionName , options } , getOSVersionOperationSpec ) ; } param location param options private _listOSVersions ( location , options ? ) { return this . client . sendOperationRequest ( { location , options } , listOSVersionsOperationSpec ) ; } param location param osFamilyName param options getOSFamily ( location , osFamilyName , options ? ) { return this . client . sendOperationRequest ( { location , osFamilyName , options } , getOSFamilyOperationSpec ) ; } param location param options private _listOSFamilies ( location , options ? ) { return this . client . sendOperationRequest ( { location , options } , listOSFamiliesOperationSpec ) ; } param location param nextLink param options private _listOSVersionsNext ( location , nextLink , options ? ) { return this . client . sendOperationRequest ( { location , nextLink , options } , listOSVersionsNextOperationSpec ) ; } param location param nextLink param options private _listOSFamiliesNext ( location , nextLink , options ? ) { return this . client . sendOperationRequest ( { location , nextLink , options } , listOSFamiliesNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getOSVersionOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OSVersion } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion2 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location , Parameters . osVersionName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOSVersionsOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OSVersionListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion2 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOSFamilyOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OSFamily } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion2 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location , Parameters . osFamilyName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOSFamiliesOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OSFamilyListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion2 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOSVersionsNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OSVersionListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion2 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOSFamiliesNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OSFamilyListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion2 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ;