diff --git a/sdk/cdn/arm-cdn/CHANGELOG.md b/sdk/cdn/arm-cdn/CHANGELOG.md index 8a7441ca6d4b..3c2e5219fc9a 100644 --- a/sdk/cdn/arm-cdn/CHANGELOG.md +++ b/sdk/cdn/arm-cdn/CHANGELOG.md @@ -1,5 +1,33 @@ # Release History + +## 8.0.0 (2022-05-30) + +**Features** + + - Added operation CustomDomains.beginDisableCustomHttps + - Added operation CustomDomains.beginDisableCustomHttpsAndWait + - Added operation CustomDomains.beginEnableCustomHttps + - Added operation CustomDomains.beginEnableCustomHttpsAndWait + - Added Type Alias EndpointProvisioningState + - Added Type Alias OriginGroupProvisioningState + - Added Type Alias OriginProvisioningState + - Added Type Alias ProfileProvisioningState + - Added Type Alias ResourceUsageUnit + - Interface CustomDomainsDisableCustomHttpsOptionalParams has a new optional parameter resumeFrom + - Interface CustomDomainsDisableCustomHttpsOptionalParams has a new optional parameter updateIntervalInMs + - Interface CustomDomainsEnableCustomHttpsOptionalParams has a new optional parameter resumeFrom + - Interface CustomDomainsEnableCustomHttpsOptionalParams has a new optional parameter updateIntervalInMs + - Added Enum KnownEndpointProvisioningState + - Added Enum KnownOriginGroupProvisioningState + - Added Enum KnownOriginProvisioningState + - Added Enum KnownProfileProvisioningState + - Added Enum KnownResourceUsageUnit +**Breaking Changes** + + - Removed operation CustomDomains.disableCustomHttps + - Removed operation CustomDomains.enableCustomHttps + ## 7.0.1 (2022-04-21) **Features** diff --git a/sdk/cdn/arm-cdn/_meta.json b/sdk/cdn/arm-cdn/_meta.json index 041fb3efa0b7..05a0cb376ca8 100644 --- a/sdk/cdn/arm-cdn/_meta.json +++ b/sdk/cdn/arm-cdn/_meta.json @@ -1,8 +1,8 @@ { - "commit": "82fdf284eea880a8e027c354911a814999a77178", + "commit": "8eea3c40ccb2db6da253b86a834c267ddc3cca30", "readme": "specification/cdn/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:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\cdn\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.17 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/cdn/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.0", - "use": "@autorest/typescript@6.0.0-beta.17" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.1", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/cdn/arm-cdn/package.json b/sdk/cdn/arm-cdn/package.json index 3eb8e9926133..a675f7947be7 100644 --- a/sdk/cdn/arm-cdn/package.json +++ b/sdk/cdn/arm-cdn/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CdnManagementClient.", - "version": "7.0.1", + "version": "8.0.0", "engines": { "node": ">=12.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "keywords": [ @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cdn/arm-cdn", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -106,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-cdn?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/cdn/arm-cdn/review/arm-cdn.api.md b/sdk/cdn/arm-cdn/review/arm-cdn.api.md index 641e9dfe1e14..54accadffad6 100644 --- a/sdk/cdn/arm-cdn/review/arm-cdn.api.md +++ b/sdk/cdn/arm-cdn/review/arm-cdn.api.md @@ -866,7 +866,7 @@ export type CustomDomain = ProxyResource & { readonly customHttpsProvisioningSubstate?: CustomHttpsProvisioningSubstate; customHttpsParameters?: CustomDomainHttpsParametersUnion; validationData?: string; - readonly provisioningState?: string; + readonly provisioningState?: CustomHttpsProvisioningState; }; // @public @@ -899,8 +899,10 @@ export interface CustomDomains { beginCreateAndWait(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, customDomainProperties: CustomDomainParameters, options?: CustomDomainsCreateOptionalParams): Promise; beginDelete(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsDeleteOptionalParams): Promise; - disableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsDisableCustomHttpsOptionalParams): Promise; - enableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsEnableCustomHttpsOptionalParams): Promise; + beginDisableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsDisableCustomHttpsOptionalParams): Promise, CustomDomainsDisableCustomHttpsResponse>>; + beginDisableCustomHttpsAndWait(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsDisableCustomHttpsOptionalParams): Promise; + beginEnableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsEnableCustomHttpsOptionalParams): Promise, CustomDomainsEnableCustomHttpsResponse>>; + beginEnableCustomHttpsAndWait(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsEnableCustomHttpsOptionalParams): Promise; get(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsGetOptionalParams): Promise; listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options?: CustomDomainsListByEndpointOptionalParams): PagedAsyncIterableIterator; } @@ -922,6 +924,8 @@ export interface CustomDomainsDeleteOptionalParams extends coreClient.OperationO // @public export interface CustomDomainsDisableCustomHttpsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -930,6 +934,8 @@ export type CustomDomainsDisableCustomHttpsResponse = CustomDomain; // @public export interface CustomDomainsEnableCustomHttpsOptionalParams extends coreClient.OperationOptions { customDomainHttpsParameters?: CustomDomainHttpsParametersUnion; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1278,7 +1284,7 @@ export type Endpoint = TrackedResource & { originGroups?: DeepCreatedOriginGroup[]; readonly customDomains?: CustomDomain[]; readonly resourceState?: EndpointResourceState; - readonly provisioningState?: string; + readonly provisioningState?: EndpointProvisioningState; }; // @public @@ -1294,7 +1300,7 @@ export type EndpointProperties = EndpointPropertiesUpdateParameters & { originGroups?: DeepCreatedOriginGroup[]; readonly customDomains?: CustomDomain[]; readonly resourceState?: EndpointResourceState; - readonly provisioningState?: string; + readonly provisioningState?: EndpointProvisioningState; }; // @public @@ -1326,6 +1332,9 @@ export interface EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyL id?: string; } +// @public +export type EndpointProvisioningState = string; + // @public export type EndpointResourceState = string; @@ -1899,6 +1908,20 @@ export enum KnownEnabledState { Enabled = "Enabled" } +// @public +export enum KnownEndpointProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + // @public export enum KnownEndpointResourceState { // (undocumented) @@ -2199,6 +2222,20 @@ export enum KnownOptimizationType { VideoOnDemandMediaStreaming = "VideoOnDemandMediaStreaming" } +// @public +export enum KnownOriginGroupProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + // @public export enum KnownOriginGroupResourceState { // (undocumented) @@ -2209,6 +2246,20 @@ export enum KnownOriginGroupResourceState { Deleting = "Deleting" } +// @public +export enum KnownOriginProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + // @public export enum KnownOriginResourceState { // (undocumented) @@ -2313,6 +2364,20 @@ export enum KnownPrivateEndpointStatus { Timeout = "Timeout" } +// @public +export enum KnownProfileProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + // @public export enum KnownProfileResourceState { // (undocumented) @@ -2513,6 +2578,12 @@ export enum KnownResourceType { MicrosoftCdnProfilesEndpoints = "Microsoft.Cdn/Profiles/Endpoints" } +// @public +export enum KnownResourceUsageUnit { + // (undocumented) + Count = "count" +} + // @public export enum KnownRuleCacheBehavior { // (undocumented) @@ -3194,7 +3265,7 @@ export type Origin = ProxyResource & { privateLinkLocation?: string; privateLinkApprovalMessage?: string; readonly resourceState?: OriginResourceState; - readonly provisioningState?: string; + readonly provisioningState?: OriginProvisioningState; readonly privateEndpointStatus?: PrivateEndpointStatus; }; @@ -3205,7 +3276,7 @@ export type OriginGroup = ProxyResource & { trafficRestorationTimeToHealedOrNewEndpointsInMinutes?: number; responseBasedOriginErrorDetectionSettings?: ResponseBasedOriginErrorDetectionParameters; readonly resourceState?: OriginGroupResourceState; - readonly provisioningState?: string; + readonly provisioningState?: OriginGroupProvisioningState; }; // @public @@ -3236,9 +3307,12 @@ export interface OriginGroupOverrideActionParameters { // @public export type OriginGroupProperties = OriginGroupUpdatePropertiesParameters & { readonly resourceState?: OriginGroupResourceState; - readonly provisioningState?: string; + readonly provisioningState?: OriginGroupProvisioningState; }; +// @public +export type OriginGroupProvisioningState = string; + // @public export type OriginGroupResourceState = string; @@ -3324,10 +3398,13 @@ export interface OriginListResult { // @public export type OriginProperties = OriginUpdatePropertiesParameters & { readonly resourceState?: OriginResourceState; - readonly provisioningState?: string; + readonly provisioningState?: OriginProvisioningState; readonly privateEndpointStatus?: PrivateEndpointStatus; }; +// @public +export type OriginProvisioningState = string; + // @public export type OriginResourceState = string; @@ -3521,7 +3598,7 @@ export type Profile = TrackedResource & { sku: Sku; readonly kind?: string; readonly resourceState?: ProfileResourceState; - readonly provisioningState?: string; + readonly provisioningState?: ProfileProvisioningState; readonly frontDoorId?: string; originResponseTimeoutSeconds?: number; }; @@ -3532,6 +3609,9 @@ export interface ProfileListResult { readonly value?: Profile[]; } +// @public +export type ProfileProvisioningState = string; + // @public export type ProfileResourceState = string; @@ -3876,7 +3956,7 @@ export interface ResourceUsage { readonly currentValue?: number; readonly limit?: number; readonly resourceType?: string; - readonly unit?: string; + readonly unit?: ResourceUsageUnit; } // @public @@ -3904,6 +3984,9 @@ export interface ResourceUsageOperations { list(options?: ResourceUsageListOptionalParams): PagedAsyncIterableIterator; } +// @public +export type ResourceUsageUnit = string; + // @public export type ResponseBasedDetectedErrorTypes = "None" | "TcpErrorsOnly" | "TcpAndHttpErrors"; diff --git a/sdk/cdn/arm-cdn/src/cdnManagementClient.ts b/sdk/cdn/arm-cdn/src/cdnManagementClient.ts index cf2e03046430..9a6d192fb7e9 100644 --- a/sdk/cdn/arm-cdn/src/cdnManagementClient.ts +++ b/sdk/cdn/arm-cdn/src/cdnManagementClient.ts @@ -7,6 +7,12 @@ */ import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { AfdProfilesImpl, @@ -105,7 +111,7 @@ export class CdnManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-cdn/7.0.1`; + const packageDetails = `azsdk-js-arm-cdn/8.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -124,6 +130,29 @@ export class CdnManagementClient extends coreClient.ServiceClient { options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const 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 + } + }) + ); + } + } // Parameter assignments this.subscriptionId = subscriptionId; @@ -152,6 +181,35 @@ export class CdnManagementClient extends coreClient.ServiceClient { this.edgeNodes = new EdgeNodesImpl(this); this.policies = new PoliciesImpl(this); this.managedRuleSets = new ManagedRuleSetsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } /** diff --git a/sdk/cdn/arm-cdn/src/models/index.ts b/sdk/cdn/arm-cdn/src/models/index.ts index 697542b9b162..0a97b50300a1 100644 --- a/sdk/cdn/arm-cdn/src/models/index.ts +++ b/sdk/cdn/arm-cdn/src/models/index.ts @@ -1012,10 +1012,10 @@ export interface ResourceUsage { */ readonly resourceType?: string; /** - * Unit of the usage. e.g. Count. + * Unit of the usage. e.g. count. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unit?: string; + readonly unit?: ResourceUsageUnit; /** * Actual value of usage on the specified resource type. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1631,7 +1631,7 @@ export interface ManagedRuleSet { export interface ManagedRuleGroupOverride { /** Describes the managed rule group within the rule set to override */ ruleGroupName: string; - /** List of rules that will be disabled. If none specified, all rules in the group will be disabled. */ + /** List of rules that will be enabled. If none specified, all rules in the group will be disabled. */ rules?: ManagedRuleOverride[]; } @@ -2580,7 +2580,7 @@ export type EndpointProperties = EndpointPropertiesUpdateParameters & { * Provisioning status of the endpoint. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: EndpointProvisioningState; }; /** The JSON object that contains the properties of the origin. */ @@ -2594,7 +2594,7 @@ export type OriginProperties = OriginUpdatePropertiesParameters & { * Provisioning status of the origin. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: OriginProvisioningState; /** * The approval status for the connection to the Private Link * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2613,7 +2613,7 @@ export type OriginGroupProperties = OriginGroupUpdatePropertiesParameters & { * Provisioning status of the origin group. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: OriginGroupProvisioningState; }; /** Defines a rate limiting rule that can be included in a waf policy */ @@ -2870,7 +2870,7 @@ export type CustomDomain = ProxyResource & { */ readonly resourceState?: CustomDomainResourceState; /** - * Provisioning status of Custom Https of the custom domain. + * Provisioning status of the custom domain. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly customHttpsProvisioningState?: CustomHttpsProvisioningState; @@ -2884,10 +2884,10 @@ export type CustomDomain = ProxyResource & { /** Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. */ validationData?: string; /** - * Provisioning status of the custom domain. + * Provisioning status of Custom Https of the custom domain. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: CustomHttpsProvisioningState; }; /** CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. */ @@ -2923,7 +2923,7 @@ export type Origin = ProxyResource & { * Provisioning status of the origin. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: OriginProvisioningState; /** * The approval status for the connection to the Private Link * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2950,7 +2950,7 @@ export type OriginGroup = ProxyResource & { * Provisioning status of the origin group. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: OriginGroupProvisioningState; }; /** Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. */ @@ -3002,7 +3002,7 @@ export type Profile = TrackedResource & { * Provisioning status of the profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: ProfileProvisioningState; /** * The Id of the frontdoor. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3065,7 +3065,7 @@ export type Endpoint = TrackedResource & { * Provisioning status of the endpoint. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly provisioningState?: EndpointProvisioningState; }; /** Defines web application firewall policy for Azure CDN. */ @@ -3849,6 +3849,28 @@ export enum KnownProfileResourceState { */ export type ProfileResourceState = string; +/** Known values of {@link ProfileProvisioningState} that the service accepts. */ +export enum KnownProfileProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Updating = "Updating", + Deleting = "Deleting", + Creating = "Creating" +} + +/** + * Defines values for ProfileProvisioningState. \ + * {@link KnownProfileProvisioningState} can be used interchangeably with ProfileProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Updating** \ + * **Deleting** \ + * **Creating** + */ +export type ProfileProvisioningState = string; + /** Known values of {@link OptimizationType} that the service accepts. */ export enum KnownOptimizationType { GeneralWebDelivery = "GeneralWebDelivery", @@ -3871,6 +3893,20 @@ export enum KnownOptimizationType { */ export type OptimizationType = string; +/** Known values of {@link ResourceUsageUnit} that the service accepts. */ +export enum KnownResourceUsageUnit { + Count = "count" +} + +/** + * Defines values for ResourceUsageUnit. \ + * {@link KnownResourceUsageUnit} can be used interchangeably with ResourceUsageUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **count** + */ +export type ResourceUsageUnit = string; + /** Known values of {@link PrivateEndpointStatus} that the service accepts. */ export enum KnownPrivateEndpointStatus { Pending = "Pending", @@ -4021,6 +4057,28 @@ export enum KnownEndpointResourceState { */ export type EndpointResourceState = string; +/** Known values of {@link EndpointProvisioningState} that the service accepts. */ +export enum KnownEndpointProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Updating = "Updating", + Deleting = "Deleting", + Creating = "Creating" +} + +/** + * Defines values for EndpointProvisioningState. \ + * {@link KnownEndpointProvisioningState} can be used interchangeably with EndpointProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Updating** \ + * **Deleting** \ + * **Creating** + */ +export type EndpointProvisioningState = string; + /** Known values of {@link OriginResourceState} that the service accepts. */ export enum KnownOriginResourceState { Creating = "Creating", @@ -4039,6 +4097,28 @@ export enum KnownOriginResourceState { */ export type OriginResourceState = string; +/** Known values of {@link OriginProvisioningState} that the service accepts. */ +export enum KnownOriginProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Updating = "Updating", + Deleting = "Deleting", + Creating = "Creating" +} + +/** + * Defines values for OriginProvisioningState. \ + * {@link KnownOriginProvisioningState} can be used interchangeably with OriginProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Updating** \ + * **Deleting** \ + * **Creating** + */ +export type OriginProvisioningState = string; + /** Known values of {@link OriginGroupResourceState} that the service accepts. */ export enum KnownOriginGroupResourceState { Creating = "Creating", @@ -4057,6 +4137,28 @@ export enum KnownOriginGroupResourceState { */ export type OriginGroupResourceState = string; +/** Known values of {@link OriginGroupProvisioningState} that the service accepts. */ +export enum KnownOriginGroupProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Updating = "Updating", + Deleting = "Deleting", + Creating = "Creating" +} + +/** + * Defines values for OriginGroupProvisioningState. \ + * {@link KnownOriginGroupProvisioningState} can be used interchangeably with OriginGroupProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Updating** \ + * **Deleting** \ + * **Creating** + */ +export type OriginGroupProvisioningState = string; + /** Known values of {@link PolicyEnabledState} that the service accepts. */ export enum KnownPolicyEnabledState { Disabled = "Disabled", @@ -6132,7 +6234,12 @@ export interface CustomDomainsDeleteOptionalParams /** Optional parameters. */ export interface CustomDomainsDisableCustomHttpsOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the disableCustomHttps operation. */ export type CustomDomainsDisableCustomHttpsResponse = CustomDomain; @@ -6142,6 +6249,10 @@ export interface CustomDomainsEnableCustomHttpsOptionalParams extends coreClient.OperationOptions { /** The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed certificate by default. */ customDomainHttpsParameters?: CustomDomainHttpsParametersUnion; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } /** Contains response data for the enableCustomHttps operation. */ diff --git a/sdk/cdn/arm-cdn/src/operations/afdEndpoints.ts b/sdk/cdn/arm-cdn/src/operations/afdEndpoints.ts index ba46654dc1ba..d5b2305d0288 100644 --- a/sdk/cdn/arm-cdn/src/operations/afdEndpoints.ts +++ b/sdk/cdn/arm-cdn/src/operations/afdEndpoints.ts @@ -126,7 +126,7 @@ export class AfdEndpointsImpl implements AfdEndpoints { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. @@ -651,7 +651,7 @@ export class AfdEndpointsImpl implements AfdEndpoints { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. @@ -671,7 +671,8 @@ export class AfdEndpointsImpl implements AfdEndpoints { } /** - * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api + * isn't work for apex domain. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operations/afdOriginGroups.ts b/sdk/cdn/arm-cdn/src/operations/afdOriginGroups.ts index 81ae0adcd7d4..f15e167d8358 100644 --- a/sdk/cdn/arm-cdn/src/operations/afdOriginGroups.ts +++ b/sdk/cdn/arm-cdn/src/operations/afdOriginGroups.ts @@ -121,7 +121,8 @@ export class AfdOriginGroupsImpl implements AfdOriginGroups { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN + * profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. @@ -536,7 +537,8 @@ export class AfdOriginGroupsImpl implements AfdOriginGroups { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN + * profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operations/afdProfiles.ts b/sdk/cdn/arm-cdn/src/operations/afdProfiles.ts index cc172de0ed8c..91a5fb44437d 100644 --- a/sdk/cdn/arm-cdn/src/operations/afdProfiles.ts +++ b/sdk/cdn/arm-cdn/src/operations/afdProfiles.ts @@ -37,7 +37,7 @@ export class AfdProfilesImpl implements AfdProfiles { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile * which is unique within the resource group. @@ -109,7 +109,7 @@ export class AfdProfilesImpl implements AfdProfiles { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile * which is unique within the resource group. @@ -127,7 +127,7 @@ export class AfdProfilesImpl implements AfdProfiles { } /** - * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * Check the name availability of a host name. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile * which is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operations/customDomains.ts b/sdk/cdn/arm-cdn/src/operations/customDomains.ts index a237f122c4d6..7287c839fb8a 100644 --- a/sdk/cdn/arm-cdn/src/operations/customDomains.ts +++ b/sdk/cdn/arm-cdn/src/operations/customDomains.ts @@ -10,7 +10,6 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { CustomDomains } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; -import * as Models from "../models"; import * as Parameters from "../models/parameters"; import { CdnManagementClient } from "../cdnManagementClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; @@ -32,8 +31,6 @@ import { CustomDomainsEnableCustomHttpsResponse, CustomDomainsListByEndpointNextResponse } from "../models"; -import { ProfilesImpl } from "./profiles"; -import { type } from "os"; /// /** Class containing CustomDomains operations. */ @@ -389,14 +386,59 @@ export class CustomDomainsImpl implements CustomDomains { * @param customDomainName Name of the custom domain within an endpoint. * @param options The options parameters. */ - disableCustomHttps( + async beginDisableCustomHttps( resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsDisableCustomHttpsOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + CustomDomainsDisableCustomHttpsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, profileName, @@ -406,6 +448,37 @@ export class CustomDomainsImpl implements CustomDomains { }, disableCustomHttpsOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Disable https delivery of the custom domain. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param options The options parameters. + */ + async beginDisableCustomHttpsAndWait( + resourceGroupName: string, + profileName: string, + endpointName: string, + customDomainName: string, + options?: CustomDomainsDisableCustomHttpsOptionalParams + ): Promise { + const poller = await this.beginDisableCustomHttps( + resourceGroupName, + profileName, + endpointName, + customDomainName, + options + ); + return poller.pollUntilDone(); } /** @@ -416,44 +489,99 @@ export class CustomDomainsImpl implements CustomDomains { * @param customDomainName Name of the custom domain within an endpoint. * @param options The options parameters. */ - enableCustomHttps( + async beginEnableCustomHttps( resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: CustomDomainsEnableCustomHttpsOptionalParams - ): Promise { - // #region Added default values to add backwards compatibility - let newOptions: Models.CustomDomainsEnableCustomHttpsOptionalParams = {}; - newOptions = options as Models.CustomDomainsEnableCustomHttpsOptionalParams; - - if (!newOptions) { - newOptions = {}; - } - - let optionsPreparationPromise = Promise.resolve(options); + ): Promise< + PollerLike< + PollOperationState, + CustomDomainsEnableCustomHttpsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - if (!newOptions.customDomainHttpsParameters) { - let profiles = new ProfilesImpl(this.client); - optionsPreparationPromise = profiles.get(resourceGroupName, profileName).then(profile => { - newOptions.customDomainHttpsParameters = getDefaultCustomDomainHttpsParameters(profile); - return newOptions; - }) - } + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + profileName, + endpointName, + customDomainName, + options + }, + enableCustomHttpsOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } - return optionsPreparationPromise.then(options => - this.client.sendOperationRequest( - { - resourceGroupName, - profileName, - endpointName, - customDomainName, - options - }, - enableCustomHttpsOperationSpec - ) + /** + * Enable https delivery of the custom domain. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param options The options parameters. + */ + async beginEnableCustomHttpsAndWait( + resourceGroupName: string, + profileName: string, + endpointName: string, + customDomainName: string, + options?: CustomDomainsEnableCustomHttpsOptionalParams + ): Promise { + const poller = await this.beginEnableCustomHttps( + resourceGroupName, + profileName, + endpointName, + customDomainName, + options ); - // #endregion + return poller.pollUntilDone(); } /** @@ -477,50 +605,6 @@ export class CustomDomainsImpl implements CustomDomains { ); } } - -// #region Added default values to add backwards compatibility -class SkuNames { - public static get standard_microsoft() { return "Standard_Microsoft"; } - public static get standard_verizon() { return "Standard_Verizon"; } - public static get standard_akamai() { return "Standard_Akamai"; } -} - -function getDefaultCustomDomainHttpsParameters(profile: Models.Profile): Models.CdnManagedHttpsParameters | undefined { - switch (profile.sku.name) { - case SkuNames.standard_microsoft: - return { - certificateSource: "Cdn", - certificateSourceParameters: { - certificateType: "Dedicated", - typeName: "CdnCertificateSourceParameters" - }, - protocolType: "ServerNameIndication" - } - case SkuNames.standard_akamai: - return { - certificateSource: "Cdn", - certificateSourceParameters: { - certificateType: "Shared", - typeName: "CdnCertificateSourceParameters" - }, - protocolType: "ServerNameIndication" - } - case SkuNames.standard_verizon: - return { - certificateSource: "Cdn", - certificateSourceParameters: { - certificateType: "Shared", - typeName: "CdnCertificateSourceParameters" - }, - protocolType: "IPBased" - } - default: - return undefined; - } -} - -// #endregion - // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -636,10 +720,18 @@ const disableCustomHttpsOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps", httpMethod: "POST", responses: { - 200: {}, + 200: { + bodyMapper: Mappers.CustomDomain + }, + 201: { + bodyMapper: Mappers.CustomDomain + }, 202: { bodyMapper: Mappers.CustomDomain }, + 204: { + bodyMapper: Mappers.CustomDomain + }, default: { bodyMapper: Mappers.ErrorResponse } @@ -661,10 +753,18 @@ const enableCustomHttpsOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps", httpMethod: "POST", responses: { - 200: {}, + 200: { + bodyMapper: Mappers.CustomDomain + }, + 201: { + bodyMapper: Mappers.CustomDomain + }, 202: { bodyMapper: Mappers.CustomDomain }, + 204: { + bodyMapper: Mappers.CustomDomain + }, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/cdn/arm-cdn/src/operations/ruleSets.ts b/sdk/cdn/arm-cdn/src/operations/ruleSets.ts index 5c67e7843a60..4646e6cb11a2 100644 --- a/sdk/cdn/arm-cdn/src/operations/ruleSets.ts +++ b/sdk/cdn/arm-cdn/src/operations/ruleSets.ts @@ -118,7 +118,7 @@ export class RuleSetsImpl implements RuleSets { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. @@ -350,7 +350,7 @@ export class RuleSetsImpl implements RuleSets { } /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operationsInterfaces/afdEndpoints.ts b/sdk/cdn/arm-cdn/src/operationsInterfaces/afdEndpoints.ts index 071b147c5994..216aa9febad4 100644 --- a/sdk/cdn/arm-cdn/src/operationsInterfaces/afdEndpoints.ts +++ b/sdk/cdn/arm-cdn/src/operationsInterfaces/afdEndpoints.ts @@ -44,7 +44,7 @@ export interface AfdEndpoints { options?: AfdEndpointsListByProfileOptionalParams ): PagedAsyncIterableIterator; /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. @@ -221,7 +221,8 @@ export interface AfdEndpoints { options?: AfdEndpointsPurgeContentOptionalParams ): Promise; /** - * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api + * isn't work for apex domain. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operationsInterfaces/afdOriginGroups.ts b/sdk/cdn/arm-cdn/src/operationsInterfaces/afdOriginGroups.ts index 4b29fd9bca96..b682942fe135 100644 --- a/sdk/cdn/arm-cdn/src/operationsInterfaces/afdOriginGroups.ts +++ b/sdk/cdn/arm-cdn/src/operationsInterfaces/afdOriginGroups.ts @@ -39,7 +39,8 @@ export interface AfdOriginGroups { options?: AfdOriginGroupsListByProfileOptionalParams ): PagedAsyncIterableIterator; /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN + * profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operationsInterfaces/afdProfiles.ts b/sdk/cdn/arm-cdn/src/operationsInterfaces/afdProfiles.ts index 58cb25bf0a43..6178f5c7b8d8 100644 --- a/sdk/cdn/arm-cdn/src/operationsInterfaces/afdProfiles.ts +++ b/sdk/cdn/arm-cdn/src/operationsInterfaces/afdProfiles.ts @@ -19,7 +19,7 @@ import { /** Interface representing a AfdProfiles. */ export interface AfdProfiles { /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile * which is unique within the resource group. @@ -31,7 +31,7 @@ export interface AfdProfiles { options?: AfdProfilesListResourceUsageOptionalParams ): PagedAsyncIterableIterator; /** - * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * Check the name availability of a host name. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile * which is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/src/operationsInterfaces/customDomains.ts b/sdk/cdn/arm-cdn/src/operationsInterfaces/customDomains.ts index cf0939fdfda8..35c1811fd64f 100644 --- a/sdk/cdn/arm-cdn/src/operationsInterfaces/customDomains.ts +++ b/sdk/cdn/arm-cdn/src/operationsInterfaces/customDomains.ts @@ -131,7 +131,27 @@ export interface CustomDomains { * @param customDomainName Name of the custom domain within an endpoint. * @param options The options parameters. */ - disableCustomHttps( + beginDisableCustomHttps( + resourceGroupName: string, + profileName: string, + endpointName: string, + customDomainName: string, + options?: CustomDomainsDisableCustomHttpsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CustomDomainsDisableCustomHttpsResponse + > + >; + /** + * Disable https delivery of the custom domain. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param options The options parameters. + */ + beginDisableCustomHttpsAndWait( resourceGroupName: string, profileName: string, endpointName: string, @@ -146,7 +166,27 @@ export interface CustomDomains { * @param customDomainName Name of the custom domain within an endpoint. * @param options The options parameters. */ - enableCustomHttps( + beginEnableCustomHttps( + resourceGroupName: string, + profileName: string, + endpointName: string, + customDomainName: string, + options?: CustomDomainsEnableCustomHttpsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CustomDomainsEnableCustomHttpsResponse + > + >; + /** + * Enable https delivery of the custom domain. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param options The options parameters. + */ + beginEnableCustomHttpsAndWait( resourceGroupName: string, profileName: string, endpointName: string, diff --git a/sdk/cdn/arm-cdn/src/operationsInterfaces/ruleSets.ts b/sdk/cdn/arm-cdn/src/operationsInterfaces/ruleSets.ts index 2adec0bcc7c1..02a7a0c27de0 100644 --- a/sdk/cdn/arm-cdn/src/operationsInterfaces/ruleSets.ts +++ b/sdk/cdn/arm-cdn/src/operationsInterfaces/ruleSets.ts @@ -36,7 +36,7 @@ export interface RuleSets { options?: RuleSetsListByProfileOptionalParams ): PagedAsyncIterableIterator; /** - * Checks the quota and actual usage of endpoints under the given CDN profile. + * Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which * is unique within the resource group. diff --git a/sdk/cdn/arm-cdn/test/sampleTest.ts b/sdk/cdn/arm-cdn/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/cdn/arm-cdn/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/cdn/arm-cdn/tsconfig.json b/sdk/cdn/arm-cdn/tsconfig.json index d80de3340da5..3e6ae96443f3 100644 --- a/sdk/cdn/arm-cdn/tsconfig.json +++ b/sdk/cdn/arm-cdn/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-cdn": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"