diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ea719a2d94b5..3367c9cf2498 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3680,7 +3680,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20230112 + typescript: 5.0.0-dev.20230115 dev: false /downlevel-dts/0.7.0: @@ -8277,8 +8277,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20230112: - resolution: {integrity: sha512-cO+lTlZiNKqZIkjDOZWjh4WtFz8Jba/Ut4nvjcguXGgHoEnHD3+LSmgJjotPcWxALJZyvpd4EuAd5D3H9XF8Ig==} + /typescript/5.0.0-dev.20230115: + resolution: {integrity: sha512-nwKvgk3rIDN9pa4fuI5vdpvR9LcLnFsLV/1HE4I5LTULB/DsN6MMeE1UF69L2RKCsv0PFYx4GXCWOsZUt/Jx9w==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -14034,7 +14034,7 @@ packages: dev: false file:projects/arm-servicefabricmesh.tgz: - resolution: {integrity: sha512-7LyJMlkDydEMcyjodZ14ZqqfNiL52JtxnlZLYF/Q2TGd+GvLXpFfNbZl/967NiLDnaVURqvU31QUJTD0WsmKUg==, tarball: file:projects/arm-servicefabricmesh.tgz} + resolution: {integrity: sha512-JHm0GpvBLyAKSKmvwlYw1yVaJL066Kb3iuI8zqSH3psUHa6/GksGIPoQO8vTjhNHfDijl4dpghgp3/pFRQANkw==, tarball: file:projects/arm-servicefabricmesh.tgz} name: '@rush-temp/arm-servicefabricmesh' version: 0.0.0 dependencies: @@ -14045,18 +14045,18 @@ packages: '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 + '@types/node': 14.18.36 chai: 4.3.7 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_7e8d81808a761355f6c3da2f25cfe887 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - supports-color dev: false @@ -17974,7 +17974,7 @@ packages: dev: false file:projects/perf-storage-blob.tgz: - resolution: {integrity: sha512-kI/qJeEMQ1YPbHIB1MBdNx128oCKfr7p3dO4eyS+1hTEVTpUdRmffqa6OqAa+DNSSr4BWd9LEbVqMo1VLJaypw==, tarball: file:projects/perf-storage-blob.tgz} + resolution: {integrity: sha512-jK57Eg/wAEJQ9F/7j4JZzWpOODHK9T4kEqWTw3IZEaFGA6saKefrIDm+l1AS15vWD/lGDOioiibtkyHDE8w5mQ==, tarball: file:projects/perf-storage-blob.tgz} name: '@rush-temp/perf-storage-blob' version: 0.0.0 dependencies: @@ -18933,7 +18933,7 @@ packages: dev: false file:projects/synapse-managed-private-endpoints.tgz: - resolution: {integrity: sha512-sLJ5bTTZ+Og0WevfNPAAWLhyXvDgk3GarbQwwkNP8gQgP1IUESaXpnzW/uJZkDs0z7T9CqK//M/vJDCj/OmdeQ==, tarball: file:projects/synapse-managed-private-endpoints.tgz} + resolution: {integrity: sha512-zXcV4TSfY+5W5n3XkXzs7sofBsEf6CnHJKZmckvk2ZIs4yprRA8+9HrJxUdWm6hXGaEl5/eVeEwqCDHL8CUpug==, tarball: file:projects/synapse-managed-private-endpoints.tgz} name: '@rush-temp/synapse-managed-private-endpoints' version: 0.0.0 dependencies: @@ -18973,7 +18973,6 @@ packages: transitivePeerDependencies: - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false @@ -19156,7 +19155,7 @@ packages: dev: false file:projects/test-utils-perf.tgz: - resolution: {integrity: sha512-xucqchHdnYwM2FR86EIEsRh5Z3TtRMTwTivenrEwVfv0JVrU418HYXODjvE65GtuPtOK+Egn+Ftm5Ej78LbUAg==, tarball: file:projects/test-utils-perf.tgz} + resolution: {integrity: sha512-e0SWxrRiG1Zf9QaOueeMh/BUv53IiuT7oOU8Vf53Cx4LX2TwdgsWKvZH2GMWdSpAtZqKDJ9niw90PqqSdeX5Gw==, tarball: file:projects/test-utils-perf.tgz} name: '@rush-temp/test-utils-perf' version: 0.0.0 dependencies: diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/CHANGELOG.md b/sdk/servicefabricmesh/arm-servicefabricmesh/CHANGELOG.md index 77d8a92d1ee6..d4f646d2f8b6 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/CHANGELOG.md +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 3.0.0-beta.4 (2023-01-16) -## 3.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 3.0.0-beta.3 (2022-06-15) - -The package of @azure/arm-servicefabricmesh is using our next generation design principles since version 3.0.0-beta.3, which contains breaking changes. +The package of @azure/arm-servicefabricmesh is using our next generation design principles since version 3.0.0-beta.4, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/LICENSE b/sdk/servicefabricmesh/arm-servicefabricmesh/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/LICENSE +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/_meta.json b/sdk/servicefabricmesh/arm-servicefabricmesh/_meta.json index 2d4455589319..20d35df902ff 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/_meta.json +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/_meta.json @@ -1,8 +1,8 @@ { - "commit": "aa42d66d5b919ea80c8dde04ae19d30a9c974d7d", + "commit": "c5ba78b6893d4c2d4518c8eb3872aaac273211bb", "readme": "specification/servicefabricmesh/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\servicefabricmesh\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.20 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/servicefabricmesh/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-beta.20" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/package.json b/sdk/servicefabricmesh/arm-servicefabricmesh/package.json index c44a0c1e6bfe..2531c5bf7333 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/package.json +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -34,7 +34,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -44,6 +44,7 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", + "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabricmesh/arm-servicefabricmesh", @@ -96,8 +97,7 @@ "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -108,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-servicefabricmesh?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/review/arm-servicefabricmesh.api.md b/sdk/servicefabricmesh/arm-servicefabricmesh/review/arm-servicefabricmesh.api.md index 0826ce4734c0..0144d9bc9469 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/review/arm-servicefabricmesh.api.md +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/review/arm-servicefabricmesh.api.md @@ -9,12 +9,12 @@ import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public -export type AddRemoveReplicaScalingMechanism = AutoScalingMechanism & { +export interface AddRemoveReplicaScalingMechanism extends AutoScalingMechanism { kind: "AddRemoveReplica"; - minCount: number; maxCount: number; + minCount: number; scaleIncrement: number; -}; +} // @public export interface Application { @@ -85,18 +85,18 @@ export interface ApplicationProperties { } // @public -export type ApplicationResourceDescription = TrackedResource & { - readonly provisioningState?: string; +export interface ApplicationResourceDescription extends TrackedResource { + debugParams?: string; description?: string; - services?: ServiceResourceDescription[]; diagnostics?: DiagnosticsDescription; - debugParams?: string; + readonly healthState?: HealthState; + readonly provisioningState?: string; readonly serviceNames?: string[]; + services?: ServiceResourceDescription[]; readonly status?: ResourceStatus; readonly statusDetails?: string; - readonly healthState?: HealthState; readonly unhealthyEvaluation?: string; -}; +} // @public export interface ApplicationResourceDescriptionList { @@ -105,12 +105,13 @@ export interface ApplicationResourceDescriptionList { } // @public -export type ApplicationResourceProperties = ProvisionedResourceProperties & ApplicationProperties; +export interface ApplicationResourceProperties extends ProvisionedResourceProperties, ApplicationProperties { +} // @public -export type ApplicationScopedVolume = VolumeReference & { +export interface ApplicationScopedVolume extends VolumeReference { creationParameters: ApplicationScopedVolumeCreationParametersUnion; -}; +} // @public export interface ApplicationScopedVolumeCreationParameters { @@ -119,10 +120,10 @@ export interface ApplicationScopedVolumeCreationParameters { } // @public -export type ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk = ApplicationScopedVolumeCreationParameters & { +export interface ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk extends ApplicationScopedVolumeCreationParameters { kind: "ServiceFabricVolumeDisk"; sizeDisk: SizeTypes; -}; +} // @public (undocumented) export type ApplicationScopedVolumeCreationParametersUnion = ApplicationScopedVolumeCreationParameters | ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk; @@ -160,10 +161,10 @@ export interface AutoScalingPolicy { } // @public -export type AutoScalingResourceMetric = AutoScalingMetric & { +export interface AutoScalingResourceMetric extends AutoScalingMetric { kind: "Resource"; name: AutoScalingResourceMetricName; -}; +} // @public export type AutoScalingResourceMetricName = string; @@ -188,23 +189,23 @@ export interface AvailableOperationDisplay { } // @public -export type AverageLoadScalingTrigger = AutoScalingTrigger & { +export interface AverageLoadScalingTrigger extends AutoScalingTrigger { kind: "AverageLoad"; - metric: AutoScalingMetricUnion; lowerLoadThreshold: number; - upperLoadThreshold: number; + metric: AutoScalingMetricUnion; scaleIntervalInSeconds: number; -}; + upperLoadThreshold: number; +} // @public -export type AzureInternalMonitoringPipelineSinkDescription = DiagnosticsSinkProperties & { - kind: "AzureInternalMonitoringPipeline"; +export interface AzureInternalMonitoringPipelineSinkDescription extends DiagnosticsSinkProperties { accountName?: string; - namespace?: string; - maConfigUrl?: string; - fluentdConfigUrl?: any; autoKeyConfigUrl?: string; -}; + fluentdConfigUrl?: any; + kind: "AzureInternalMonitoringPipeline"; + maConfigUrl?: string; + namespace?: string; +} // @public export interface CodePackage { @@ -416,17 +417,17 @@ export interface GatewayProperties { } // @public -export type GatewayResourceDescription = TrackedResource & { - readonly provisioningState?: string; +export interface GatewayResourceDescription extends TrackedResource { description?: string; - sourceNetwork: NetworkRef; destinationNetwork: NetworkRef; - tcp?: TcpConfig[]; http?: HttpConfig[]; + readonly ipAddress?: string; + readonly provisioningState?: string; + sourceNetwork: NetworkRef; readonly status?: ResourceStatus; readonly statusDetails?: string; - readonly ipAddress?: string; -}; + tcp?: TcpConfig[]; +} // @public export interface GatewayResourceDescriptionList { @@ -435,7 +436,11 @@ export interface GatewayResourceDescriptionList { } // @public -export type GatewayResourceProperties = ProvisionedResourceProperties & GatewayProperties; +export interface GatewayResourceProperties extends ProvisionedResourceProperties, GatewayProperties { +} + +// @public +export function getContinuationToken(page: unknown): string | undefined; // @public export type HeaderMatchType = string; @@ -491,7 +496,9 @@ export interface ImageRegistryCredential { } // @public -export type InlinedValueSecretResourceProperties = SecretResourceProperties; +export interface InlinedValueSecretResourceProperties extends SecretResourceProperties { + kind: "inlinedValue"; +} // @public export enum KnownApplicationScopedVolumeKind { @@ -527,7 +534,6 @@ export enum KnownDiagnosticsSinkKind { // @public export enum KnownHeaderMatchType { - // (undocumented) Exact = "exact" } @@ -553,7 +559,6 @@ export enum KnownOperatingSystemType { // @public export enum KnownPathMatchType { - // (undocumented) Prefix = "prefix" } @@ -574,11 +579,8 @@ export enum KnownSecretKind { // @public export enum KnownSizeTypes { - // (undocumented) Large = "Large", - // (undocumented) Medium = "Medium", - // (undocumented) Small = "Small" } @@ -588,9 +590,10 @@ export enum KnownVolumeProvider { } // @public -export type LocalNetworkResourceProperties = NetworkResourceProperties & { +export interface LocalNetworkResourceProperties extends NetworkResourceProperties { + kind: "Local"; networkAddressPrefix?: string; -}; +} // @public export interface ManagedProxyResource { @@ -664,9 +667,9 @@ export interface NetworkRef { } // @public -export type NetworkResourceDescription = TrackedResource & { +export interface NetworkResourceDescription extends TrackedResource { properties: NetworkResourcePropertiesUnion; -}; +} // @public export interface NetworkResourceDescriptionList { @@ -675,16 +678,17 @@ export interface NetworkResourceDescriptionList { } // @public -export type NetworkResourceProperties = NetworkResourcePropertiesBase & { +export interface NetworkResourceProperties extends NetworkResourcePropertiesBase { description?: string; + kind: "NetworkResourceProperties" | "Local"; readonly status?: ResourceStatus; readonly statusDetails?: string; -}; +} // @public -export type NetworkResourcePropertiesBase = ProvisionedResourceProperties & { +export interface NetworkResourcePropertiesBase extends ProvisionedResourceProperties { kind: NetworkKind; -}; +} // @public (undocumented) export type NetworkResourcePropertiesBaseUnion = NetworkResourcePropertiesBase | NetworkResourcePropertiesUnion; @@ -737,7 +741,8 @@ export interface ProvisionedResourceProperties { } // @public -export type ProxyResource = Resource; +export interface ProxyResource extends Resource { +} // @public export interface ReliableCollectionsRef { @@ -832,9 +837,9 @@ export interface SecretListBySubscriptionOptionalParams extends coreClient.Opera export type SecretListBySubscriptionResponse = SecretResourceDescriptionList; // @public -export type SecretResourceDescription = TrackedResource & { +export interface SecretResourceDescription extends TrackedResource { properties: SecretResourcePropertiesUnion; -}; +} // @public export interface SecretResourceDescriptionList { @@ -843,17 +848,18 @@ export interface SecretResourceDescriptionList { } // @public -export type SecretResourceProperties = SecretResourcePropertiesBase & { +export interface SecretResourceProperties extends SecretResourcePropertiesBase { + contentType?: string; description?: string; + kind: "SecretResourceProperties" | "inlinedValue"; readonly status?: ResourceStatus; readonly statusDetails?: string; - contentType?: string; -}; +} // @public -export type SecretResourcePropertiesBase = ProvisionedResourceProperties & { +export interface SecretResourcePropertiesBase extends ProvisionedResourceProperties { kind: SecretKind; -}; +} // @public (undocumented) export type SecretResourcePropertiesBaseUnion = SecretResourcePropertiesBase | SecretResourcePropertiesUnion; @@ -920,10 +926,10 @@ export interface SecretValueProperties { } // @public -export type SecretValueResourceDescription = TrackedResource & { +export interface SecretValueResourceDescription extends TrackedResource { readonly provisioningState?: string; value?: string; -}; +} // @public export interface SecretValueResourceDescriptionList { @@ -932,7 +938,8 @@ export interface SecretValueResourceDescriptionList { } // @public -export type SecretValueResourceProperties = ProvisionedResourceProperties & SecretValueProperties; +export interface SecretValueResourceProperties extends ProvisionedResourceProperties, SecretValueProperties { +} // @public export interface Service { @@ -1017,9 +1024,9 @@ export interface ServiceReplica { } // @public -export type ServiceReplicaDescription = ServiceReplicaProperties & { +export interface ServiceReplicaDescription extends ServiceReplicaProperties { replicaName: string; -}; +} // @public export interface ServiceReplicaDescriptionList { @@ -1057,20 +1064,20 @@ export interface ServiceReplicaProperties { } // @public -export type ServiceResourceDescription = ManagedProxyResource & { - readonly provisioningState?: string; - osType: OperatingSystemType; +export interface ServiceResourceDescription extends ManagedProxyResource { + autoScalingPolicies?: AutoScalingPolicy[]; codePackages: ContainerCodePackageProperties[]; - networkRefs?: NetworkRef[]; - diagnostics?: DiagnosticsRef; description?: string; + diagnostics?: DiagnosticsRef; + readonly healthState?: HealthState; + networkRefs?: NetworkRef[]; + osType: OperatingSystemType; + readonly provisioningState?: string; replicaCount?: number; - autoScalingPolicies?: AutoScalingPolicy[]; readonly status?: ResourceStatus; readonly statusDetails?: string; - readonly healthState?: HealthState; readonly unhealthyEvaluation?: string; -}; +} // @public export interface ServiceResourceDescriptionList { @@ -1079,7 +1086,8 @@ export interface ServiceResourceDescriptionList { } // @public -export type ServiceResourceProperties = ProvisionedResourceProperties & ServiceReplicaProperties & ServiceProperties; +export interface ServiceResourceProperties extends ProvisionedResourceProperties, ServiceReplicaProperties, ServiceProperties { +} // @public export interface Setting { @@ -1098,12 +1106,12 @@ export interface TcpConfig { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public export interface Volume { @@ -1187,14 +1195,14 @@ export interface VolumeReference { } // @public -export type VolumeResourceDescription = TrackedResource & { - readonly provisioningState?: string; +export interface VolumeResourceDescription extends TrackedResource { + azureFileParameters?: VolumeProviderParametersAzureFile; description?: string; + provider: VolumeProvider; + readonly provisioningState?: string; readonly status?: ResourceStatus; readonly statusDetails?: string; - provider: VolumeProvider; - azureFileParameters?: VolumeProviderParametersAzureFile; -}; +} // @public export interface VolumeResourceDescriptionList { @@ -1203,7 +1211,8 @@ export interface VolumeResourceDescriptionList { } // @public -export type VolumeResourceProperties = ProvisionedResourceProperties & VolumeProperties; +export interface VolumeResourceProperties extends ProvisionedResourceProperties, VolumeProperties { +} // (No @packageDocumentation comment for this package) diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/index.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/index.ts index f1fa17540658..85789f72544a 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/index.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { ServiceFabricMeshManagementClient } from "./serviceFabricMeshManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/index.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/index.ts index 534ced6026e7..26a6ebe843e5 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/index.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/index.ts @@ -676,71 +676,79 @@ export interface AutoScalingMetric { } /** This type describes the properties of a secret resource, including its kind. */ -export type SecretResourcePropertiesBase = ProvisionedResourceProperties & { +export interface SecretResourcePropertiesBase + extends ProvisionedResourceProperties { /** Describes the kind of secret. */ kind: SecretKind; -}; +} /** This type describes properties of a secret value resource. */ -export type SecretValueResourceProperties = ProvisionedResourceProperties & - SecretValueProperties; +export interface SecretValueResourceProperties + extends ProvisionedResourceProperties, + SecretValueProperties {} /** This type describes properties of a volume resource. */ -export type VolumeResourceProperties = ProvisionedResourceProperties & - VolumeProperties; +export interface VolumeResourceProperties + extends ProvisionedResourceProperties, + VolumeProperties {} /** This type describes the properties of a network resource, including its kind. */ -export type NetworkResourcePropertiesBase = ProvisionedResourceProperties & { +export interface NetworkResourcePropertiesBase + extends ProvisionedResourceProperties { /** The type of a Service Fabric container network. */ kind: NetworkKind; -}; +} /** This type describes properties of a gateway resource. */ -export type GatewayResourceProperties = ProvisionedResourceProperties & - GatewayProperties; +export interface GatewayResourceProperties + extends ProvisionedResourceProperties, + GatewayProperties {} /** This type describes properties of a service resource. */ -export type ServiceResourceProperties = ProvisionedResourceProperties & - ServiceReplicaProperties & - ServiceProperties; +export interface ServiceResourceProperties + extends ProvisionedResourceProperties, + ServiceReplicaProperties, + ServiceProperties {} /** This type describes properties of an application resource. */ -export type ApplicationResourceProperties = ProvisionedResourceProperties & - ApplicationProperties; +export interface ApplicationResourceProperties + extends ProvisionedResourceProperties, + ApplicationProperties {} /** The resource model definition for Azure Resource Manager tracked top-level resource. */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** The resource model definition for Azure Resource Manager proxy resource. It will have everything other than required location and tags. */ -export type ProxyResource = Resource; +export interface ProxyResource extends Resource {} /** Describes a replica of a service resource. */ -export type ServiceReplicaDescription = ServiceReplicaProperties & { +export interface ServiceReplicaDescription extends ServiceReplicaProperties { /** Name of the replica. */ replicaName: string; -}; +} /** Describes a volume whose lifetime is scoped to the application's lifetime. */ -export type ApplicationScopedVolume = VolumeReference & { +export interface ApplicationScopedVolume extends VolumeReference { /** Describes parameters for creating application-scoped volumes. */ creationParameters: ApplicationScopedVolumeCreationParametersUnion; -}; +} /** Describes parameters for creating application-scoped volumes provided by Service Fabric Volume Disks */ -export type ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk = ApplicationScopedVolumeCreationParameters & { +export interface ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk + extends ApplicationScopedVolumeCreationParameters { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "ServiceFabricVolumeDisk"; /** Volume size */ sizeDisk: SizeTypes; -}; +} /** Describes the average load trigger used for auto scaling. */ -export type AverageLoadScalingTrigger = AutoScalingTrigger & { +export interface AverageLoadScalingTrigger extends AutoScalingTrigger { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "AverageLoad"; /** Description of the metric that is used for scaling. */ @@ -751,10 +759,10 @@ export type AverageLoadScalingTrigger = AutoScalingTrigger & { upperLoadThreshold: number; /** Scale interval that indicates how often will this trigger be checked. */ scaleIntervalInSeconds: number; -}; +} /** Describes the horizontal auto scaling mechanism that adds or removes replicas (containers or container groups). */ -export type AddRemoveReplicaScalingMechanism = AutoScalingMechanism & { +export interface AddRemoveReplicaScalingMechanism extends AutoScalingMechanism { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "AddRemoveReplica"; /** Minimum number of containers (scale down won't be performed below this number). */ @@ -763,10 +771,10 @@ export type AddRemoveReplicaScalingMechanism = AutoScalingMechanism & { maxCount: number; /** Each time auto scaling is performed, this number of containers will be added or removed. */ scaleIncrement: number; -}; +} /** This type describes a service resource. */ -export type ServiceResourceDescription = ManagedProxyResource & { +export interface ServiceResourceDescription extends ManagedProxyResource { /** * State of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -806,10 +814,11 @@ export type ServiceResourceDescription = ManagedProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly unhealthyEvaluation?: string; -}; +} /** Diagnostics settings for Geneva. */ -export type AzureInternalMonitoringPipelineSinkDescription = DiagnosticsSinkProperties & { +export interface AzureInternalMonitoringPipelineSinkDescription + extends DiagnosticsSinkProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "AzureInternalMonitoringPipeline"; /** Azure Internal monitoring pipeline account. */ @@ -822,18 +831,20 @@ export type AzureInternalMonitoringPipelineSinkDescription = DiagnosticsSinkProp fluentdConfigUrl?: any; /** Azure Internal monitoring pipeline autokey associated with the certificate. */ autoKeyConfigUrl?: string; -}; +} /** Describes the resource that is used for triggering auto scaling. */ -export type AutoScalingResourceMetric = AutoScalingMetric & { +export interface AutoScalingResourceMetric extends AutoScalingMetric { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "Resource"; /** Name of the resource. */ name: AutoScalingResourceMetricName; -}; +} /** Describes the properties of a secret resource. */ -export type SecretResourceProperties = SecretResourcePropertiesBase & { +export interface SecretResourceProperties extends SecretResourcePropertiesBase { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "SecretResourceProperties" | "inlinedValue"; /** User readable description of the secret. */ description?: string; /** @@ -848,10 +859,13 @@ export type SecretResourceProperties = SecretResourcePropertiesBase & { readonly statusDetails?: string; /** The type of the content stored in the secret value. The value of this property is opaque to Service Fabric. Once set, the value of this property cannot be changed. */ contentType?: string; -}; +} /** Describes properties of a network resource. */ -export type NetworkResourceProperties = NetworkResourcePropertiesBase & { +export interface NetworkResourceProperties + extends NetworkResourcePropertiesBase { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "NetworkResourceProperties" | "Local"; /** User readable description of the network. */ description?: string; /** @@ -864,16 +878,16 @@ export type NetworkResourceProperties = NetworkResourcePropertiesBase & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly statusDetails?: string; -}; +} /** This type describes a secret resource. */ -export type SecretResourceDescription = TrackedResource & { +export interface SecretResourceDescription extends TrackedResource { /** Describes the properties of a secret resource. */ properties: SecretResourcePropertiesUnion; -}; +} /** This type describes a value of a secret resource. The name of this resource is the version identifier corresponding to this secret value. */ -export type SecretValueResourceDescription = TrackedResource & { +export interface SecretValueResourceDescription extends TrackedResource { /** * State of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -881,10 +895,10 @@ export type SecretValueResourceDescription = TrackedResource & { readonly provisioningState?: string; /** The actual value of the secret. */ value?: string; -}; +} /** This type describes a volume resource. */ -export type VolumeResourceDescription = TrackedResource & { +export interface VolumeResourceDescription extends TrackedResource { /** * State of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -906,16 +920,16 @@ export type VolumeResourceDescription = TrackedResource & { provider: VolumeProvider; /** This type describes a volume provided by an Azure Files file share. */ azureFileParameters?: VolumeProviderParametersAzureFile; -}; +} /** This type describes a network resource. */ -export type NetworkResourceDescription = TrackedResource & { +export interface NetworkResourceDescription extends TrackedResource { /** Describes properties of a network resource. */ properties: NetworkResourcePropertiesUnion; -}; +} /** This type describes a gateway resource. */ -export type GatewayResourceDescription = TrackedResource & { +export interface GatewayResourceDescription extends TrackedResource { /** * State of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -946,10 +960,10 @@ export type GatewayResourceDescription = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly ipAddress?: string; -}; +} /** This type describes an application resource. */ -export type ApplicationResourceDescription = TrackedResource & { +export interface ApplicationResourceDescription extends TrackedResource { /** * State of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -988,16 +1002,23 @@ export type ApplicationResourceDescription = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly unhealthyEvaluation?: string; -}; +} /** Describes the properties of a secret resource whose value is provided explicitly as plaintext. The secret resource may have multiple values, each being uniquely versioned. The secret value of each version is stored encrypted, and delivered as plaintext into the context of applications referencing it. */ -export type InlinedValueSecretResourceProperties = SecretResourceProperties; +export interface InlinedValueSecretResourceProperties + extends SecretResourceProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "inlinedValue"; +} /** Information about a Service Fabric container network local to a single Service Fabric cluster. */ -export type LocalNetworkResourceProperties = NetworkResourceProperties & { +export interface LocalNetworkResourceProperties + extends NetworkResourceProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "Local"; /** Address space for the local container network. */ networkAddressPrefix?: string; -}; +} /** Known values of {@link ResourceStatus} that the service accepts. */ export enum KnownResourceStatus { @@ -1076,6 +1097,7 @@ export type NetworkKind = string; /** Known values of {@link PathMatchType} that the service accepts. */ export enum KnownPathMatchType { + /** Prefix */ Prefix = "prefix" } @@ -1090,6 +1112,7 @@ export type PathMatchType = string; /** Known values of {@link HeaderMatchType} that the service accepts. */ export enum KnownHeaderMatchType { + /** Exact */ Exact = "exact" } @@ -1212,8 +1235,11 @@ export type DiagnosticsSinkKind = string; /** Known values of {@link SizeTypes} that the service accepts. */ export enum KnownSizeTypes { + /** Small */ Small = "Small", + /** Medium */ Medium = "Medium", + /** Large */ Large = "Large" } diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/mappers.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/mappers.ts index 0820bead7a1f..f532f60040eb 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/mappers.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/models/mappers.ts @@ -2311,7 +2311,7 @@ export const SecretResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "SecretResourceProperties", - uberParent: "ProvisionedResourceProperties", + uberParent: "SecretResourcePropertiesBase", polymorphicDiscriminator: { serializedName: "kind", clientName: "kind" @@ -2353,7 +2353,7 @@ export const NetworkResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "NetworkResourceProperties", - uberParent: "ProvisionedResourceProperties", + uberParent: "NetworkResourcePropertiesBase", polymorphicDiscriminator: { serializedName: "kind", clientName: "kind" @@ -2667,9 +2667,9 @@ export const InlinedValueSecretResourceProperties: coreClient.CompositeMapper = type: { name: "Composite", className: "InlinedValueSecretResourceProperties", - uberParent: "ProvisionedResourceProperties", + uberParent: "SecretResourceProperties", polymorphicDiscriminator: - ProvisionedResourceProperties.type.polymorphicDiscriminator, + SecretResourceProperties.type.polymorphicDiscriminator, modelProperties: { ...SecretResourceProperties.type.modelProperties } @@ -2681,9 +2681,9 @@ export const LocalNetworkResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "LocalNetworkResourceProperties", - uberParent: "ProvisionedResourceProperties", + uberParent: "NetworkResourceProperties", polymorphicDiscriminator: - ProvisionedResourceProperties.type.polymorphicDiscriminator, + NetworkResourceProperties.type.polymorphicDiscriminator, modelProperties: { ...NetworkResourceProperties.type.modelProperties, networkAddressPrefix: { @@ -2709,8 +2709,8 @@ export let discriminators = { "AutoScalingMechanism.AddRemoveReplica": AddRemoveReplicaScalingMechanism, "DiagnosticsSinkProperties.AzureInternalMonitoringPipeline": AzureInternalMonitoringPipelineSinkDescription, "AutoScalingMetric.Resource": AutoScalingResourceMetric, - "ProvisionedResourceProperties.SecretResourceProperties": SecretResourceProperties, - "ProvisionedResourceProperties.NetworkResourceProperties": NetworkResourceProperties, - "ProvisionedResourceProperties.inlinedValue": InlinedValueSecretResourceProperties, - "ProvisionedResourceProperties.Local": LocalNetworkResourceProperties + "SecretResourcePropertiesBase.SecretResourceProperties": SecretResourceProperties, + "NetworkResourcePropertiesBase.NetworkResourceProperties": NetworkResourceProperties, + "SecretResourceProperties.inlinedValue": InlinedValueSecretResourceProperties, + "NetworkResourceProperties.Local": LocalNetworkResourceProperties }; diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/application.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/application.ts index 9114b8b572aa..24aefa99e9f6 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/application.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/application.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Application } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { ApplicationResourceDescription, ApplicationListByResourceGroupNextOptionalParams, ApplicationListByResourceGroupOptionalParams, + ApplicationListByResourceGroupResponse, ApplicationListBySubscriptionNextOptionalParams, ApplicationListBySubscriptionOptionalParams, + ApplicationListBySubscriptionResponse, ApplicationCreateOptionalParams, ApplicationCreateResponse, ApplicationGetOptionalParams, ApplicationGetResponse, ApplicationDeleteOptionalParams, - ApplicationListByResourceGroupResponse, - ApplicationListBySubscriptionResponse, ApplicationListByResourceGroupNextResponse, ApplicationListBySubscriptionNextResponse } from "../models"; @@ -60,19 +61,33 @@ export class ApplicationImpl implements Application { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ApplicationListByResourceGroupOptionalParams + options?: ApplicationListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ApplicationListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -80,7 +95,9 @@ export class ApplicationImpl implements Application { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class ApplicationImpl implements Application { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: ApplicationListBySubscriptionOptionalParams + options?: ApplicationListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ApplicationListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -386,7 +415,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -407,7 +435,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/gateway.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/gateway.ts index b45ec24fe85a..7df450d4603b 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/gateway.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/gateway.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Gateway } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { GatewayResourceDescription, GatewayListByResourceGroupNextOptionalParams, GatewayListByResourceGroupOptionalParams, + GatewayListByResourceGroupResponse, GatewayListBySubscriptionNextOptionalParams, GatewayListBySubscriptionOptionalParams, + GatewayListBySubscriptionResponse, GatewayCreateOptionalParams, GatewayCreateResponse, GatewayGetOptionalParams, GatewayGetResponse, GatewayDeleteOptionalParams, - GatewayListByResourceGroupResponse, - GatewayListBySubscriptionResponse, GatewayListByResourceGroupNextResponse, GatewayListBySubscriptionNextResponse } from "../models"; @@ -60,19 +61,33 @@ export class GatewayImpl implements Gateway { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: GatewayListByResourceGroupOptionalParams + options?: GatewayListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GatewayListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -80,7 +95,9 @@ export class GatewayImpl implements Gateway { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class GatewayImpl implements Gateway { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: GatewayListBySubscriptionOptionalParams + options?: GatewayListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GatewayListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -387,7 +416,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -408,7 +436,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/network.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/network.ts index 1e7b9f59cedc..e2efea11bfb4 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/network.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/network.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Network } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { NetworkResourceDescription, NetworkListByResourceGroupNextOptionalParams, NetworkListByResourceGroupOptionalParams, + NetworkListByResourceGroupResponse, NetworkListBySubscriptionNextOptionalParams, NetworkListBySubscriptionOptionalParams, + NetworkListBySubscriptionResponse, NetworkCreateOptionalParams, NetworkCreateResponse, NetworkGetOptionalParams, NetworkGetResponse, NetworkDeleteOptionalParams, - NetworkListByResourceGroupResponse, - NetworkListBySubscriptionResponse, NetworkListByResourceGroupNextResponse, NetworkListBySubscriptionNextResponse } from "../models"; @@ -60,19 +61,33 @@ export class NetworkImpl implements Network { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: NetworkListByResourceGroupOptionalParams + options?: NetworkListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: NetworkListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -80,7 +95,9 @@ export class NetworkImpl implements Network { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class NetworkImpl implements Network { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: NetworkListBySubscriptionOptionalParams + options?: NetworkListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: NetworkListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -386,7 +415,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -407,7 +435,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/operations.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/operations.ts index a5dfb03f6a6f..3d016aa04509 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/operations.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/operations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,22 +49,34 @@ export class OperationsImpl implements Operations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secret.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secret.ts index 7bde98747cec..0cf66216c97c 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secret.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secret.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Secret } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { SecretResourceDescription, SecretListByResourceGroupNextOptionalParams, SecretListByResourceGroupOptionalParams, + SecretListByResourceGroupResponse, SecretListBySubscriptionNextOptionalParams, SecretListBySubscriptionOptionalParams, + SecretListBySubscriptionResponse, SecretCreateOptionalParams, SecretCreateResponse, SecretGetOptionalParams, SecretGetResponse, SecretDeleteOptionalParams, - SecretListByResourceGroupResponse, - SecretListBySubscriptionResponse, SecretListByResourceGroupNextResponse, SecretListBySubscriptionNextResponse } from "../models"; @@ -60,19 +61,33 @@ export class SecretImpl implements Secret { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: SecretListByResourceGroupOptionalParams + options?: SecretListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SecretListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -80,7 +95,9 @@ export class SecretImpl implements Secret { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class SecretImpl implements Secret { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: SecretListBySubscriptionOptionalParams + options?: SecretListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SecretListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -385,7 +414,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -406,7 +434,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secretValueOperations.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secretValueOperations.ts index 44792b0817da..6525dd08e4e3 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secretValueOperations.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/secretValueOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SecretValueOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,12 +17,12 @@ import { SecretValueResourceDescription, SecretValueListNextOptionalParams, SecretValueListOptionalParams, + SecretValueListResponse, SecretValueCreateOptionalParams, SecretValueCreateResponse, SecretValueGetOptionalParams, SecretValueGetResponse, SecretValueDeleteOptionalParams, - SecretValueListResponse, SecretValueListValueOptionalParams, SecretValueListValueResponse, SecretValueListNextResponse @@ -64,11 +65,15 @@ export class SecretValueOperationsImpl implements SecretValueOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, secretResourceName, - options + options, + settings ); } }; @@ -77,15 +82,18 @@ export class SecretValueOperationsImpl implements SecretValueOperations { private async *listPagingPage( resourceGroupName: string, secretResourceName: string, - options?: SecretValueListOptionalParams + options?: SecretValueListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - secretResourceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SecretValueListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, secretResourceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -94,7 +102,9 @@ export class SecretValueOperationsImpl implements SecretValueOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -390,7 +400,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/service.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/service.ts index c05a00f780d3..94ca0322d496 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/service.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/service.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Service } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { ServiceResourceDescription, ServiceListNextOptionalParams, ServiceListOptionalParams, + ServiceListResponse, ServiceGetOptionalParams, ServiceGetResponse, - ServiceListResponse, ServiceListNextResponse } from "../models"; @@ -59,11 +60,15 @@ export class ServiceImpl implements Service { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, applicationResourceName, - options + options, + settings ); } }; @@ -72,15 +77,22 @@ export class ServiceImpl implements Service { private async *listPagingPage( resourceGroupName: string, applicationResourceName: string, - options?: ServiceListOptionalParams + options?: ServiceListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - applicationResourceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ServiceListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + applicationResourceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -89,7 +101,9 @@ export class ServiceImpl implements Service { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -228,7 +242,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/serviceReplica.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/serviceReplica.ts index f18985d61b73..80661923306d 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/serviceReplica.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/serviceReplica.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ServiceReplica } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { ServiceReplicaDescription, ServiceReplicaListNextOptionalParams, ServiceReplicaListOptionalParams, + ServiceReplicaListResponse, ServiceReplicaGetOptionalParams, ServiceReplicaGetResponse, - ServiceReplicaListResponse, ServiceReplicaListNextResponse } from "../models"; @@ -62,12 +63,16 @@ export class ServiceReplicaImpl implements ServiceReplica { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, applicationResourceName, serviceResourceName, - options + options, + settings ); } }; @@ -77,16 +82,23 @@ export class ServiceReplicaImpl implements ServiceReplica { resourceGroupName: string, applicationResourceName: string, serviceResourceName: string, - options?: ServiceReplicaListOptionalParams + options?: ServiceReplicaListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - applicationResourceName, - serviceResourceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ServiceReplicaListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + applicationResourceName, + serviceResourceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -96,7 +108,9 @@ export class ServiceReplicaImpl implements ServiceReplica { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -257,7 +271,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/volume.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/volume.ts index 717b3b7535ef..e7a8e305c6dd 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/volume.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/operations/volume.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Volume } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { VolumeResourceDescription, VolumeListByResourceGroupNextOptionalParams, VolumeListByResourceGroupOptionalParams, + VolumeListByResourceGroupResponse, VolumeListBySubscriptionNextOptionalParams, VolumeListBySubscriptionOptionalParams, + VolumeListBySubscriptionResponse, VolumeCreateOptionalParams, VolumeCreateResponse, VolumeGetOptionalParams, VolumeGetResponse, VolumeDeleteOptionalParams, - VolumeListByResourceGroupResponse, - VolumeListBySubscriptionResponse, VolumeListByResourceGroupNextResponse, VolumeListBySubscriptionNextResponse } from "../models"; @@ -60,19 +61,33 @@ export class VolumeImpl implements Volume { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: VolumeListByResourceGroupOptionalParams + options?: VolumeListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VolumeListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -80,7 +95,9 @@ export class VolumeImpl implements Volume { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class VolumeImpl implements Volume { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: VolumeListBySubscriptionOptionalParams + options?: VolumeListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VolumeListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -385,7 +414,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -406,7 +434,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/pagingHelper.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/src/serviceFabricMeshManagementClient.ts b/sdk/servicefabricmesh/arm-servicefabricmesh/src/serviceFabricMeshManagementClient.ts index da40a4797193..4d55483711c0 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/src/serviceFabricMeshManagementClient.ts +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/src/serviceFabricMeshManagementClient.ts @@ -78,41 +78,47 @@ export class ServiceFabricMeshManagementClient extends coreClient.ServiceClient ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; @@ -148,7 +154,7 @@ export class ServiceFabricMeshManagementClient extends coreClient.ServiceClient if (param.length > 1) { const newParams = param[1].split("&").map((item) => { if (item.indexOf("api-version") > -1) { - return item.replace(/(?<==).*$/, apiVersion); + return "api-version=" + apiVersion; } else { return item; } diff --git a/sdk/servicefabricmesh/arm-servicefabricmesh/tsconfig.json b/sdk/servicefabricmesh/arm-servicefabricmesh/tsconfig.json index b352b9a4ca89..3e6ae96443f3 100644 --- a/sdk/servicefabricmesh/arm-servicefabricmesh/tsconfig.json +++ b/sdk/servicefabricmesh/arm-servicefabricmesh/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-servicefabricmesh": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"