diff --git a/sdk/cdn/arm-cdn/README.md b/sdk/cdn/arm-cdn/README.md index b6d871b13f0b..6e652e1e868a 100644 --- a/sdk/cdn/arm-cdn/README.md +++ b/sdk/cdn/arm-cdn/README.md @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/cdn/arm-cdn/README.png) diff --git a/sdk/cdn/arm-cdn/lib/cdnManagementClient.ts b/sdk/cdn/arm-cdn/lib/cdnManagementClient.ts new file mode 100644 index 000000000000..d0659fd35c4c --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/cdnManagementClient.ts @@ -0,0 +1,236 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import * as operations from "./operations"; +import { CdnManagementClientContext } from "./cdnManagementClientContext"; + + +class CdnManagementClient extends CdnManagementClientContext { + // Operation groups + profiles: operations.Profiles; + endpoints: operations.Endpoints; + origins: operations.Origins; + customDomains: operations.CustomDomains; + resourceUsage: operations.ResourceUsageOperations; + operations: operations.Operations; + edgeNodes: operations.EdgeNodes; + + /** + * Initializes a new instance of the CdnManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure Subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.CdnManagementClientOptions) { + super(credentials, subscriptionId, options); + this.profiles = new operations.Profiles(this); + this.endpoints = new operations.Endpoints(this); + this.origins = new operations.Origins(this); + this.customDomains = new operations.CustomDomains(this); + this.resourceUsage = new operations.ResourceUsageOperations(this); + this.operations = new operations.Operations(this); + this.edgeNodes = new operations.EdgeNodes(this); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally + * unique, such as a CDN endpoint. + * @param name The resource name to validate. + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param name The resource name to validate. + * @param callback The callback + */ + checkNameAvailability(name: string, callback: msRest.ServiceCallback): void; + /** + * @param name The resource name to validate. + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailability(name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkNameAvailability(name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + name, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally + * unique, such as a CDN endpoint. + * @param name The resource name to validate. + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailabilityWithSubscription(name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param name The resource name to validate. + * @param callback The callback + */ + checkNameAvailabilityWithSubscription(name: string, callback: msRest.ServiceCallback): void; + /** + * @param name The resource name to validate. + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailabilityWithSubscription(name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkNameAvailabilityWithSubscription(name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + name, + options + }, + checkNameAvailabilityWithSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to + * a file hosted on the origin server to help accelerate the delivery of dynamic content via the + * CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. + * @param probeURL The probe URL to validate. + * @param [options] The optional parameters + * @returns Promise + */ + validateProbe(probeURL: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param probeURL The probe URL to validate. + * @param callback The callback + */ + validateProbe(probeURL: string, callback: msRest.ServiceCallback): void; + /** + * @param probeURL The probe URL to validate. + * @param options The optional parameters + * @param callback The callback + */ + validateProbe(probeURL: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateProbe(probeURL: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + probeURL, + options + }, + validateProbeOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Cdn/checkNameAvailability", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + name: "name" + }, + mapper: { + ...Mappers.CheckNameAvailabilityInput, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityOutput + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const checkNameAvailabilityWithSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + name: "name" + }, + mapper: { + ...Mappers.CheckNameAvailabilityInput, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityOutput + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const validateProbeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + probeURL: "probeURL" + }, + mapper: { + ...Mappers.ValidateProbeInput, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ValidateProbeOutput + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +export { + CdnManagementClient, + CdnManagementClientContext, + Models as CdnManagementModels, + Mappers as CdnManagementMappers +}; +export * from "./operations"; diff --git a/sdk/cdn/arm-cdn/lib/cdnManagementClientContext.ts b/sdk/cdn/arm-cdn/lib/cdnManagementClientContext.ts new file mode 100644 index 000000000000..bc4e5e9d61fc --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/cdnManagementClientContext.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-cdn"; +const packageVersion = "4.2.0"; + +export class CdnManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the CdnManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure Subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.CdnManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2019-04-15'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/cdn/arm-cdn/lib/models/customDomainsMappers.ts b/sdk/cdn/arm-cdn/lib/models/customDomainsMappers.ts new file mode 100644 index 000000000000..6ae22bcdeb5d --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/customDomainsMappers.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + CustomDomainListResult, + CustomDomain, + ProxyResource, + Resource, + BaseResource, + ErrorResponse, + CustomDomainParameters, + CustomDomainHttpsParameters, + ProfileUpdateParameters, + DeepCreatedOrigin, + EndpointUpdateParameters, + GeoFilter, + EndpointPropertiesUpdateParametersDeliveryPolicy, + DeliveryRule, + DeliveryRuleCondition, + DeliveryRuleAction, + DeliveryRuleRemoteAddressCondition, + RemoteAddressMatchConditionParameters, + DeliveryRuleRequestMethodCondition, + RequestMethodMatchConditionParameters, + DeliveryRuleQueryStringCondition, + QueryStringMatchConditionParameters, + DeliveryRulePostArgsCondition, + PostArgsMatchConditionParameters, + DeliveryRuleRequestUriCondition, + RequestUriMatchConditionParameters, + DeliveryRuleRequestHeaderCondition, + RequestHeaderMatchConditionParameters, + DeliveryRuleRequestBodyCondition, + RequestBodyMatchConditionParameters, + DeliveryRuleRequestSchemeCondition, + RequestSchemeMatchConditionParameters, + DeliveryRuleUrlPathCondition, + UrlPathMatchConditionParameters, + DeliveryRuleUrlFileExtensionCondition, + UrlFileExtensionMatchConditionParameters, + DeliveryRuleUrlFileNameCondition, + UrlFileNameMatchConditionParameters, + DeliveryRuleIsDeviceCondition, + IsDeviceMatchConditionParameters, + UrlRedirectAction, + UrlRedirectActionParameters, + DeliveryRuleRequestHeaderAction, + HeaderActionParameters, + DeliveryRuleResponseHeaderAction, + DeliveryRuleCacheExpirationAction, + CacheExpirationActionParameters, + OriginUpdateParameters, + CdnManagedHttpsParameters, + CdnCertificateSourceParameters, + UserManagedHttpsParameters, + KeyVaultCertificateSourceParameters, + EdgeNode, + IpAddressGroup, + CidrIpAddress, + TrackedResource, + Profile, + Sku, + Endpoint, + Origin +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/models/edgeNodesMappers.ts b/sdk/cdn/arm-cdn/lib/models/edgeNodesMappers.ts new file mode 100644 index 000000000000..8c8293adb39c --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/edgeNodesMappers.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + EdgenodeResult, + EdgeNode, + ProxyResource, + Resource, + BaseResource, + IpAddressGroup, + CidrIpAddress, + ErrorResponse, + ProfileUpdateParameters, + DeepCreatedOrigin, + EndpointUpdateParameters, + GeoFilter, + EndpointPropertiesUpdateParametersDeliveryPolicy, + DeliveryRule, + DeliveryRuleCondition, + DeliveryRuleAction, + DeliveryRuleRemoteAddressCondition, + RemoteAddressMatchConditionParameters, + DeliveryRuleRequestMethodCondition, + RequestMethodMatchConditionParameters, + DeliveryRuleQueryStringCondition, + QueryStringMatchConditionParameters, + DeliveryRulePostArgsCondition, + PostArgsMatchConditionParameters, + DeliveryRuleRequestUriCondition, + RequestUriMatchConditionParameters, + DeliveryRuleRequestHeaderCondition, + RequestHeaderMatchConditionParameters, + DeliveryRuleRequestBodyCondition, + RequestBodyMatchConditionParameters, + DeliveryRuleRequestSchemeCondition, + RequestSchemeMatchConditionParameters, + DeliveryRuleUrlPathCondition, + UrlPathMatchConditionParameters, + DeliveryRuleUrlFileExtensionCondition, + UrlFileExtensionMatchConditionParameters, + DeliveryRuleUrlFileNameCondition, + UrlFileNameMatchConditionParameters, + DeliveryRuleIsDeviceCondition, + IsDeviceMatchConditionParameters, + UrlRedirectAction, + UrlRedirectActionParameters, + DeliveryRuleRequestHeaderAction, + HeaderActionParameters, + DeliveryRuleResponseHeaderAction, + DeliveryRuleCacheExpirationAction, + CacheExpirationActionParameters, + OriginUpdateParameters, + CustomDomain, + TrackedResource, + Profile, + Sku, + Endpoint, + Origin +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/models/endpointsMappers.ts b/sdk/cdn/arm-cdn/lib/models/endpointsMappers.ts new file mode 100644 index 000000000000..986f58022b10 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/endpointsMappers.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + EndpointListResult, + Endpoint, + TrackedResource, + Resource, + BaseResource, + GeoFilter, + EndpointPropertiesUpdateParametersDeliveryPolicy, + DeliveryRule, + DeliveryRuleCondition, + DeliveryRuleAction, + DeepCreatedOrigin, + ErrorResponse, + EndpointUpdateParameters, + PurgeParameters, + LoadParameters, + ValidateCustomDomainInput, + ValidateCustomDomainOutput, + ResourceUsageListResult, + ResourceUsage, + Profile, + Sku, + ProfileUpdateParameters, + DeliveryRuleRemoteAddressCondition, + RemoteAddressMatchConditionParameters, + DeliveryRuleRequestMethodCondition, + RequestMethodMatchConditionParameters, + DeliveryRuleQueryStringCondition, + QueryStringMatchConditionParameters, + DeliveryRulePostArgsCondition, + PostArgsMatchConditionParameters, + DeliveryRuleRequestUriCondition, + RequestUriMatchConditionParameters, + DeliveryRuleRequestHeaderCondition, + RequestHeaderMatchConditionParameters, + DeliveryRuleRequestBodyCondition, + RequestBodyMatchConditionParameters, + DeliveryRuleRequestSchemeCondition, + RequestSchemeMatchConditionParameters, + DeliveryRuleUrlPathCondition, + UrlPathMatchConditionParameters, + DeliveryRuleUrlFileExtensionCondition, + UrlFileExtensionMatchConditionParameters, + DeliveryRuleUrlFileNameCondition, + UrlFileNameMatchConditionParameters, + DeliveryRuleIsDeviceCondition, + IsDeviceMatchConditionParameters, + UrlRedirectAction, + UrlRedirectActionParameters, + DeliveryRuleRequestHeaderAction, + HeaderActionParameters, + DeliveryRuleResponseHeaderAction, + DeliveryRuleCacheExpirationAction, + CacheExpirationActionParameters, + Origin, + OriginUpdateParameters, + ProxyResource, + CustomDomain, + EdgeNode, + IpAddressGroup, + CidrIpAddress +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/models/index.ts b/sdk/cdn/arm-cdn/lib/models/index.ts new file mode 100644 index 000000000000..0c0d64257851 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/index.ts @@ -0,0 +1,3144 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing Sku. + * The pricing tier (defines a CDN provider, feature list and rate) of the CDN + * profile. + * + */ +export interface Sku { + /** + * @member {SkuName} [name] Name of the pricing tier. Possible values + * include: 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon', + * 'Standard_Akamai', 'Standard_ChinaCdn', 'Standard_Microsoft' + */ + name?: SkuName; +} + +/** + * @interface + * An interface representing Resource. + * The core properties of ARM resources + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Resource ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing TrackedResource. + * The resource model definition for a ARM tracked top level resource. + * + * @extends Resource + */ +export interface TrackedResource extends Resource { + /** + * @member {string} location Resource location. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing Profile. + * CDN profile is a logical grouping of endpoints that share the same settings, + * such as CDN provider and pricing tier. + * + * @extends TrackedResource + */ +export interface Profile extends TrackedResource { + /** + * @member {Sku} sku The pricing tier (defines a CDN provider, feature list + * and rate) of the CDN profile. + */ + sku: Sku; + /** + * @member {ProfileResourceState} [resourceState] Resource status of the + * profile. Possible values include: 'Creating', 'Active', 'Deleting', + * 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceState?: ProfileResourceState; + /** + * @member {string} [provisioningState] Provisioning status of the profile. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; +} + +/** + * @interface + * An interface representing ProfileUpdateParameters. + * Properties required to update a profile. + * + * @extends BaseResource + */ +export interface ProfileUpdateParameters extends BaseResource { + /** + * @member {{ [propertyName: string]: string }} [tags] Profile tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing SsoUri. + * The URI required to login to the supplemental portal from the Azure portal. + * + */ +export interface SsoUri { + /** + * @member {string} [ssoUriValue] The URI used to login to the supplemental + * portal. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly ssoUriValue?: string; +} + +/** + * @interface + * An interface representing SupportedOptimizationTypesListResult. + * The result of the GetSupportedOptimizationTypes API + * + */ +export interface SupportedOptimizationTypesListResult { + /** + * @member {OptimizationType[]} [supportedOptimizationTypes] Supported + * optimization types for a profile. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly supportedOptimizationTypes?: OptimizationType[]; +} + +/** + * @interface + * An interface representing DeepCreatedOrigin. + * The main origin of CDN content which is added when creating a CDN endpoint. + * + * @extends BaseResource + */ +export interface DeepCreatedOrigin extends BaseResource { + /** + * @member {string} name Origin name + */ + name: string; + /** + * @member {string} hostName The address of the origin. It can be a domain + * name, IPv4 address, or IPv6 address. + */ + hostName: string; + /** + * @member {number} [httpPort] The value of the HTTP port. Must be between 1 + * and 65535 + */ + httpPort?: number; + /** + * @member {number} [httpsPort] The value of the HTTPS port. Must be between + * 1 and 65535 + */ + httpsPort?: number; +} + +/** + * @interface + * An interface representing Endpoint. + * CDN endpoint is the entity within a CDN profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + * The CDN endpoint uses the URL format .azureedge.net. + * + * @extends TrackedResource + */ +export interface Endpoint extends TrackedResource { + /** + * @member {string} [originHostHeader] The host header value sent to the + * origin with each request. If you leave this blank, the request hostname + * determines this value. Azure CDN origins, such as Web Apps, Blob Storage, + * and Cloud Services require this host header value to match the origin + * hostname by default. + */ + originHostHeader?: string; + /** + * @member {string} [originPath] A directory path on the origin that CDN can + * use to retrieve content from, e.g. contoso.cloudapp.net/originpath. + */ + originPath?: string; + /** + * @member {string[]} [contentTypesToCompress] List of content types on which + * compression applies. The value should be a valid MIME type. + */ + contentTypesToCompress?: string[]; + /** + * @member {boolean} [isCompressionEnabled] Indicates whether content + * compression is enabled on CDN. Default value is false. If compression is + * enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on CDN when requested + * content is smaller than 1 byte or larger than 1 MB. + */ + isCompressionEnabled?: boolean; + /** + * @member {boolean} [isHttpAllowed] Indicates whether HTTP traffic is + * allowed on the endpoint. Default value is true. At least one protocol + * (HTTP or HTTPS) must be allowed. + */ + isHttpAllowed?: boolean; + /** + * @member {boolean} [isHttpsAllowed] Indicates whether HTTPS traffic is + * allowed on the endpoint. Default value is true. At least one protocol + * (HTTP or HTTPS) must be allowed. + */ + isHttpsAllowed?: boolean; + /** + * @member {QueryStringCachingBehavior} [queryStringCachingBehavior] Defines + * how CDN caches requests that include query strings. You can ignore any + * query strings when caching, bypass caching to prevent requests that + * contain query strings from being cached, or cache every request with a + * unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', + * 'UseQueryString', 'NotSet' + */ + queryStringCachingBehavior?: QueryStringCachingBehavior; + /** + * @member {OptimizationType} [optimizationType] Specifies what scenario the + * customer wants this CDN endpoint to optimize for, e.g. Download, Media + * services. With this information, CDN can apply scenario driven + * optimization. Possible values include: 'GeneralWebDelivery', + * 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', + * 'LargeFileDownload', 'DynamicSiteAcceleration' + */ + optimizationType?: OptimizationType; + /** + * @member {string} [probePath] Path to a file hosted on the origin which + * helps accelerate delivery of the dynamic content and calculate the most + * optimal routes for the CDN. This is relative to the origin path. + */ + probePath?: string; + /** + * @member {GeoFilter[]} [geoFilters] List of rules defining the user's geo + * access within a CDN endpoint. Each geo filter defines an access rule to a + * specified path or content, e.g. block APAC for path /pictures/ + */ + geoFilters?: GeoFilter[]; + /** + * @member {EndpointPropertiesUpdateParametersDeliveryPolicy} + * [deliveryPolicy] A policy that specifies the delivery rules to be used for + * an endpoint. + */ + deliveryPolicy?: EndpointPropertiesUpdateParametersDeliveryPolicy; + /** + * @member {string} [hostName] The host name of the endpoint structured as + * {endpointName}.{DNSZone}, e.g. contoso.azureedge.net + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hostName?: string; + /** + * @member {DeepCreatedOrigin[]} origins The source of the content being + * delivered via CDN. + */ + origins: DeepCreatedOrigin[]; + /** + * @member {EndpointResourceState} [resourceState] Resource status of the + * endpoint. Possible values include: 'Creating', 'Deleting', 'Running', + * 'Starting', 'Stopped', 'Stopping' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceState?: EndpointResourceState; + /** + * @member {string} [provisioningState] Provisioning status of the endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; +} + +/** + * @interface + * An interface representing GeoFilter. + * Rules defining user's geo access within a CDN endpoint. + * + */ +export interface GeoFilter { + /** + * @member {string} relativePath Relative path applicable to geo filter. + * (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) + */ + relativePath: string; + /** + * @member {GeoFilterActions} action Action of the geo filter, i.e. allow or + * block access. Possible values include: 'Block', 'Allow' + */ + action: GeoFilterActions; + /** + * @member {string[]} countryCodes Two letter country codes defining user + * country access in a geo filter, e.g. AU, MX, US. + */ + countryCodes: string[]; +} + +/** + * Contains the possible cases for DeliveryRuleCondition. + */ +export type DeliveryRuleConditionUnion = DeliveryRuleCondition | DeliveryRuleRemoteAddressCondition | DeliveryRuleRequestMethodCondition | DeliveryRuleQueryStringCondition | DeliveryRulePostArgsCondition | DeliveryRuleRequestUriCondition | DeliveryRuleRequestHeaderCondition | DeliveryRuleRequestBodyCondition | DeliveryRuleRequestSchemeCondition | DeliveryRuleUrlPathCondition | DeliveryRuleUrlFileExtensionCondition | DeliveryRuleUrlFileNameCondition | DeliveryRuleIsDeviceCondition; + +/** + * @interface + * An interface representing DeliveryRuleCondition. + * A condition for the delivery rule. + * + */ +export interface DeliveryRuleCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "DeliveryRuleCondition"; +} + +/** + * Contains the possible cases for DeliveryRuleAction. + */ +export type DeliveryRuleActionUnion = DeliveryRuleAction | UrlRedirectAction | DeliveryRuleRequestHeaderAction | DeliveryRuleResponseHeaderAction | DeliveryRuleCacheExpirationAction; + +/** + * @interface + * An interface representing DeliveryRuleAction. + * An action for the delivery rule. + * + */ +export interface DeliveryRuleAction { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "DeliveryRuleAction"; +} + +/** + * @interface + * An interface representing DeliveryRule. + * A rule that specifies a set of actions and conditions + * + */ +export interface DeliveryRule { + /** + * @member {string} name Name of the rule + */ + name: string; + /** + * @member {number} order The order in which the rules are applied for the + * endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will + * be applied before a rule with a greater order. Rule with order 0 is a + * special rule. It does not require any condition and actions listed in it + * will always be applied. + */ + order: number; + /** + * @member {DeliveryRuleConditionUnion[]} [conditions] A list of conditions + * that must be matched for the actions to be executed + */ + conditions?: DeliveryRuleConditionUnion[]; + /** + * @member {DeliveryRuleActionUnion[]} actions A list of actions that are + * executed when all the conditions of a rule are satisfied. + */ + actions: DeliveryRuleActionUnion[]; +} + +/** + * @interface + * An interface representing EndpointPropertiesUpdateParametersDeliveryPolicy. + * A policy that specifies the delivery rules to be used for an endpoint. + * + */ +export interface EndpointPropertiesUpdateParametersDeliveryPolicy { + /** + * @member {string} [description] User-friendly description of the policy. + */ + description?: string; + /** + * @member {DeliveryRule[]} rules A list of the delivery rules. + */ + rules: DeliveryRule[]; +} + +/** + * @interface + * An interface representing EndpointUpdateParameters. + * Properties required to create or update an endpoint. + * + * @extends BaseResource + */ +export interface EndpointUpdateParameters extends BaseResource { + /** + * @member {{ [propertyName: string]: string }} [tags] Endpoint tags. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {string} [originHostHeader] The host header value sent to the + * origin with each request. If you leave this blank, the request hostname + * determines this value. Azure CDN origins, such as Web Apps, Blob Storage, + * and Cloud Services require this host header value to match the origin + * hostname by default. + */ + originHostHeader?: string; + /** + * @member {string} [originPath] A directory path on the origin that CDN can + * use to retrieve content from, e.g. contoso.cloudapp.net/originpath. + */ + originPath?: string; + /** + * @member {string[]} [contentTypesToCompress] List of content types on which + * compression applies. The value should be a valid MIME type. + */ + contentTypesToCompress?: string[]; + /** + * @member {boolean} [isCompressionEnabled] Indicates whether content + * compression is enabled on CDN. Default value is false. If compression is + * enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on CDN when requested + * content is smaller than 1 byte or larger than 1 MB. + */ + isCompressionEnabled?: boolean; + /** + * @member {boolean} [isHttpAllowed] Indicates whether HTTP traffic is + * allowed on the endpoint. Default value is true. At least one protocol + * (HTTP or HTTPS) must be allowed. + */ + isHttpAllowed?: boolean; + /** + * @member {boolean} [isHttpsAllowed] Indicates whether HTTPS traffic is + * allowed on the endpoint. Default value is true. At least one protocol + * (HTTP or HTTPS) must be allowed. + */ + isHttpsAllowed?: boolean; + /** + * @member {QueryStringCachingBehavior} [queryStringCachingBehavior] Defines + * how CDN caches requests that include query strings. You can ignore any + * query strings when caching, bypass caching to prevent requests that + * contain query strings from being cached, or cache every request with a + * unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', + * 'UseQueryString', 'NotSet' + */ + queryStringCachingBehavior?: QueryStringCachingBehavior; + /** + * @member {OptimizationType} [optimizationType] Specifies what scenario the + * customer wants this CDN endpoint to optimize for, e.g. Download, Media + * services. With this information, CDN can apply scenario driven + * optimization. Possible values include: 'GeneralWebDelivery', + * 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', + * 'LargeFileDownload', 'DynamicSiteAcceleration' + */ + optimizationType?: OptimizationType; + /** + * @member {string} [probePath] Path to a file hosted on the origin which + * helps accelerate delivery of the dynamic content and calculate the most + * optimal routes for the CDN. This is relative to the origin path. + */ + probePath?: string; + /** + * @member {GeoFilter[]} [geoFilters] List of rules defining the user's geo + * access within a CDN endpoint. Each geo filter defines an access rule to a + * specified path or content, e.g. block APAC for path /pictures/ + */ + geoFilters?: GeoFilter[]; + /** + * @member {EndpointPropertiesUpdateParametersDeliveryPolicy} + * [deliveryPolicy] A policy that specifies the delivery rules to be used for + * an endpoint. + */ + deliveryPolicy?: EndpointPropertiesUpdateParametersDeliveryPolicy; +} + +/** + * @interface + * An interface representing RemoteAddressMatchConditionParameters. + * Defines the parameters for RemoteAddress match conditions + * + */ +export interface RemoteAddressMatchConditionParameters { + /** + * @member {RemoteAddressOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'IPMatch', 'GeoMatch' + */ + operator: RemoteAddressOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues Match values to match against. The operator + * will apply to each value in here with OR semantics. If any of them match + * the variable with the given operator this match condition is considered a + * match. + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleRemoteAddressCondition. + * Defines the RemoteAddress condition for the delivery rule. + * + */ +export interface DeliveryRuleRemoteAddressCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "RemoteAddress"; + /** + * @member {RemoteAddressMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: RemoteAddressMatchConditionParameters; +} + +/** + * @interface + * An interface representing RequestMethodMatchConditionParameters. + * Defines the parameters for RequestMethod match conditions + * + */ +export interface RequestMethodMatchConditionParameters { + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; +} + +/** + * @interface + * An interface representing DeliveryRuleRequestMethodCondition. + * Defines the RequestMethod condition for the delivery rule. + * + */ +export interface DeliveryRuleRequestMethodCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "RequestMethod"; + /** + * @member {RequestMethodMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: RequestMethodMatchConditionParameters; +} + +/** + * @interface + * An interface representing QueryStringMatchConditionParameters. + * Defines the parameters for QueryString match conditions + * + */ +export interface QueryStringMatchConditionParameters { + /** + * @member {QueryStringOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: QueryStringOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleQueryStringCondition. + * Defines the QueryString condition for the delivery rule. + * + */ +export interface DeliveryRuleQueryStringCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "QueryString"; + /** + * @member {QueryStringMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: QueryStringMatchConditionParameters; +} + +/** + * @interface + * An interface representing PostArgsMatchConditionParameters. + * Defines the parameters for PostArgs match conditions + * + */ +export interface PostArgsMatchConditionParameters { + /** + * @member {string} selector Name of PostArg to be matched + */ + selector: string; + /** + * @member {PostArgsOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: PostArgsOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRulePostArgsCondition. + * Defines the PostArgs condition for the delivery rule. + * + */ +export interface DeliveryRulePostArgsCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "PostArgs"; + /** + * @member {PostArgsMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: PostArgsMatchConditionParameters; +} + +/** + * @interface + * An interface representing RequestUriMatchConditionParameters. + * Defines the parameters for RequestUri match conditions + * + */ +export interface RequestUriMatchConditionParameters { + /** + * @member {RequestUriOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: RequestUriOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleRequestUriCondition. + * Defines the RequestUri condition for the delivery rule. + * + */ +export interface DeliveryRuleRequestUriCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "RequestUri"; + /** + * @member {RequestUriMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: RequestUriMatchConditionParameters; +} + +/** + * @interface + * An interface representing RequestHeaderMatchConditionParameters. + * Defines the parameters for RequestHeader match conditions + * + */ +export interface RequestHeaderMatchConditionParameters { + /** + * @member {string} selector Name of Header to be matched + */ + selector: string; + /** + * @member {RequestHeaderOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: RequestHeaderOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleRequestHeaderCondition. + * Defines the RequestHeader condition for the delivery rule. + * + */ +export interface DeliveryRuleRequestHeaderCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "RequestHeader"; + /** + * @member {RequestHeaderMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: RequestHeaderMatchConditionParameters; +} + +/** + * @interface + * An interface representing RequestBodyMatchConditionParameters. + * Defines the parameters for RequestBody match conditions + * + */ +export interface RequestBodyMatchConditionParameters { + /** + * @member {RequestBodyOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: RequestBodyOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleRequestBodyCondition. + * Defines the RequestBody condition for the delivery rule. + * + */ +export interface DeliveryRuleRequestBodyCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "RequestBody"; + /** + * @member {RequestBodyMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: RequestBodyMatchConditionParameters; +} + +/** + * @interface + * An interface representing RequestSchemeMatchConditionParameters. + * Defines the parameters for RequestScheme match conditions + * + */ +export interface RequestSchemeMatchConditionParameters { + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; +} + +/** + * @interface + * An interface representing DeliveryRuleRequestSchemeCondition. + * Defines the RequestScheme condition for the delivery rule. + * + */ +export interface DeliveryRuleRequestSchemeCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "RequestScheme"; + /** + * @member {RequestSchemeMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: RequestSchemeMatchConditionParameters; +} + +/** + * @interface + * An interface representing UrlPathMatchConditionParameters. + * Defines the parameters for UrlPath match conditions + * + */ +export interface UrlPathMatchConditionParameters { + /** + * @member {UrlPathOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual', 'Wildcard' + */ + operator: UrlPathOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleUrlPathCondition. + * Defines the UrlPath condition for the delivery rule. + * + */ +export interface DeliveryRuleUrlPathCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "UrlPath"; + /** + * @member {UrlPathMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: UrlPathMatchConditionParameters; +} + +/** + * @interface + * An interface representing UrlFileExtensionMatchConditionParameters. + * Defines the parameters for UrlFileExtension match conditions + * + */ +export interface UrlFileExtensionMatchConditionParameters { + /** + * @member {UrlFileExtensionOperator} operator Describes operator to be + * matched. Possible values include: 'Any', 'Equal', 'Contains', + * 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: UrlFileExtensionOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleUrlFileExtensionCondition. + * Defines the UrlFileExtension condition for the delivery rule. + * + */ +export interface DeliveryRuleUrlFileExtensionCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "UrlFileExtension"; + /** + * @member {UrlFileExtensionMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: UrlFileExtensionMatchConditionParameters; +} + +/** + * @interface + * An interface representing UrlFileNameMatchConditionParameters. + * Defines the parameters for UrlFilename match conditions + * + */ +export interface UrlFileNameMatchConditionParameters { + /** + * @member {UrlFileNameOperator} operator Describes operator to be matched. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', + * 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', + * 'GreaterThanOrEqual' + */ + operator: UrlFileNameOperator; + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleUrlFileNameCondition. + * Defines the UrlFileName condition for the delivery rule. + * + */ +export interface DeliveryRuleUrlFileNameCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "UrlFileName"; + /** + * @member {UrlFileNameMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: UrlFileNameMatchConditionParameters; +} + +/** + * @interface + * An interface representing IsDeviceMatchConditionParameters. + * Defines the parameters for IsDevice match conditions + * + */ +export interface IsDeviceMatchConditionParameters { + /** + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + */ + negateCondition?: boolean; + /** + * @member {string[]} matchValues The match value for the condition of the + * delivery rule + */ + matchValues: string[]; + /** + * @member {Transform[]} [transforms] List of transforms + */ + transforms?: Transform[]; +} + +/** + * @interface + * An interface representing DeliveryRuleIsDeviceCondition. + * Defines the IsDevice condition for the delivery rule. + * + */ +export interface DeliveryRuleIsDeviceCondition { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "IsDevice"; + /** + * @member {IsDeviceMatchConditionParameters} parameters Defines the + * parameters for the condition. + */ + parameters: IsDeviceMatchConditionParameters; +} + +/** + * @interface + * An interface representing UrlRedirectActionParameters. + * Defines the parameters for the url redirect action. + * + */ +export interface UrlRedirectActionParameters { + /** + * @member {RedirectType} redirectType The redirect type the rule will use + * when redirecting traffic. Possible values include: 'Moved', 'Found', + * 'TemporaryRedirect', 'PermanentRedirect' + */ + redirectType: RedirectType; + /** + * @member {DestinationProtocol} [destinationProtocol] Protocol to use for + * the redirect. The default value is MatchRequest. Possible values include: + * 'MatchRequest', 'Http', 'Https' + */ + destinationProtocol?: DestinationProtocol; + /** + * @member {string} [customPath] The full path to redirect. Path cannot be + * empty and must start with /. Leave empty to use the incoming path as + * destination path. + */ + customPath?: string; + /** + * @member {string} [customHostname] Host to redirect. Leave empty to use use + * the incoming host as the destination host. + */ + customHostname?: string; + /** + * @member {string} [customQueryString] The set of query strings to be placed + * in the redirect URL. Setting this value would replace any existing query + * string; leave empty to preserve the incoming query string. Query string + * must be in = format. ? and & will be added automatically so do + * not include them. + */ + customQueryString?: string; + /** + * @member {string} [customFragment] Fragment to add to the redirect URL. + * Fragment is the part of the URL that comes after #. Do not include the #. + */ + customFragment?: string; +} + +/** + * @interface + * An interface representing UrlRedirectAction. + * Defines the url redirect action for the delivery rule. + * + */ +export interface UrlRedirectAction { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "UrlRedirect"; + /** + * @member {UrlRedirectActionParameters} parameters Defines the parameters + * for the action. + */ + parameters: UrlRedirectActionParameters; +} + +/** + * @interface + * An interface representing HeaderActionParameters. + * Defines the parameters for the request header action. + * + */ +export interface HeaderActionParameters { + /** + * @member {HeaderAction} headerAction Action to perform. Possible values + * include: 'Append', 'Overwrite', 'Delete' + */ + headerAction: HeaderAction; + /** + * @member {string} headerName Name of the header to modify + */ + headerName: string; + /** + * @member {string} [value] Value for the specified action + */ + value?: string; +} + +/** + * @interface + * An interface representing DeliveryRuleRequestHeaderAction. + * Defines the request header action for the delivery rule. + * + */ +export interface DeliveryRuleRequestHeaderAction { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "ModifyRequestHeader"; + /** + * @member {HeaderActionParameters} parameters Defines the parameters for the + * action. + */ + parameters: HeaderActionParameters; +} + +/** + * @interface + * An interface representing DeliveryRuleResponseHeaderAction. + * Defines the response header action for the delivery rule. + * + */ +export interface DeliveryRuleResponseHeaderAction { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "ModifyResponseHeader"; + /** + * @member {HeaderActionParameters} parameters Defines the parameters for the + * action. + */ + parameters: HeaderActionParameters; +} + +/** + * @interface + * An interface representing CacheExpirationActionParameters. + * Defines the parameters for the cache expiration action. + * + */ +export interface CacheExpirationActionParameters { + /** + * @member {CacheBehavior} cacheBehavior Caching behavior for the requests. + * Possible values include: 'BypassCache', 'Override', 'SetIfMissing' + */ + cacheBehavior: CacheBehavior; + /** + * @member {string} [cacheDuration] The duration for which the content needs + * to be cached. Allowed format is [d.]hh:mm:ss + */ + cacheDuration?: string; +} + +/** + * @interface + * An interface representing DeliveryRuleCacheExpirationAction. + * Defines the cache expiration action for the delivery rule. + * + */ +export interface DeliveryRuleCacheExpirationAction { + /** + * @member {string} name Polymorphic Discriminator + */ + name: "CacheExpiration"; + /** + * @member {CacheExpirationActionParameters} parameters Defines the + * parameters for the action. + */ + parameters: CacheExpirationActionParameters; +} + +/** + * @interface + * An interface representing PurgeParameters. + * Parameters required for content purge. + * + */ +export interface PurgeParameters { + /** + * @member {string[]} contentPaths The path to the content to be purged. Can + * describe a file path or a wild card directory. + */ + contentPaths: string[]; +} + +/** + * @interface + * An interface representing LoadParameters. + * Parameters required for content load. + * + */ +export interface LoadParameters { + /** + * @member {string[]} contentPaths The path to the content to be loaded. Path + * should be a relative file URL of the origin. + */ + contentPaths: string[]; +} + +/** + * @interface + * An interface representing Origin. + * 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. + * + * @extends TrackedResource + */ +export interface Origin extends TrackedResource { + /** + * @member {string} hostName The address of the origin. Domain names, IPv4 + * addresses, and IPv6 addresses are supported. + */ + hostName: string; + /** + * @member {number} [httpPort] The value of the HTTP port. Must be between 1 + * and 65535. + */ + httpPort?: number; + /** + * @member {number} [httpsPort] The value of the https port. Must be between + * 1 and 65535. + */ + httpsPort?: number; + /** + * @member {OriginResourceState} [resourceState] Resource status of the + * origin. Possible values include: 'Creating', 'Active', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceState?: OriginResourceState; + /** + * @member {string} [provisioningState] Provisioning status of the origin. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; +} + +/** + * @interface + * An interface representing OriginUpdateParameters. + * Origin properties needed for origin creation or update. + * + * @extends BaseResource + */ +export interface OriginUpdateParameters extends BaseResource { + /** + * @member {string} [hostName] The address of the origin. Domain names, IPv4 + * addresses, and IPv6 addresses are supported. + */ + hostName?: string; + /** + * @member {number} [httpPort] The value of the HTTP port. Must be between 1 + * and 65535. + */ + httpPort?: number; + /** + * @member {number} [httpsPort] The value of the HTTPS port. Must be between + * 1 and 65535. + */ + httpsPort?: number; +} + +/** + * @interface + * An interface representing ProxyResource. + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags + * + * @extends Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * @interface + * An interface representing CustomDomain. + * Friendly domain name mapping to the endpoint hostname that the customer + * provides for branding purposes, e.g. www.contoso.com. + * + * @extends ProxyResource + */ +export interface CustomDomain extends ProxyResource { + /** + * @member {string} hostName The host name of the custom domain. Must be a + * domain name. + */ + hostName: string; + /** + * @member {CustomDomainResourceState} [resourceState] Resource status of the + * custom domain. Possible values include: 'Creating', 'Active', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceState?: CustomDomainResourceState; + /** + * @member {CustomHttpsProvisioningState} [customHttpsProvisioningState] + * Provisioning status of Custom Https of the custom domain. Possible values + * include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly customHttpsProvisioningState?: CustomHttpsProvisioningState; + /** + * @member {CustomHttpsProvisioningSubstate} + * [customHttpsProvisioningSubstate] Provisioning substate shows the progress + * of custom HTTPS enabling/disabling process step by step. Possible values + * include: 'SubmittingDomainControlValidationRequest', + * 'PendingDomainControlValidationREquestApproval', + * 'DomainControlValidationRequestApproved', + * 'DomainControlValidationRequestRejected', + * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + * 'CertificateDeleted' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly customHttpsProvisioningSubstate?: CustomHttpsProvisioningSubstate; + /** + * @member {string} [validationData] 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; + /** + * @member {string} [provisioningState] Provisioning status of the custom + * domain. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; +} + +/** + * @interface + * An interface representing CustomDomainParameters. + * The customDomain JSON object required for custom domain creation or update. + * + */ +export interface CustomDomainParameters { + /** + * @member {string} hostName The host name of the custom domain. Must be a + * domain name. + */ + hostName: string; +} + +/** + * Contains the possible cases for CustomDomainHttpsParameters. + */ +export type CustomDomainHttpsParametersUnion = CustomDomainHttpsParameters | CdnManagedHttpsParameters | UserManagedHttpsParameters; + +/** + * @interface + * An interface representing CustomDomainHttpsParameters. + * The JSON object that contains the properties to secure a custom domain. + * + */ +export interface CustomDomainHttpsParameters { + /** + * @member {string} certificateSource Polymorphic Discriminator + */ + certificateSource: "CustomDomainHttpsParameters"; + /** + * @member {ProtocolType} protocolType Defines the TLS extension protocol + * that is used for secure delivery. Possible values include: + * 'ServerNameIndication', 'IPBased' + */ + protocolType: ProtocolType; +} + +/** + * @interface + * An interface representing CdnCertificateSourceParameters. + * Defines the parameters for using CDN managed certificate for securing custom + * domain. + * + */ +export interface CdnCertificateSourceParameters { + /** + * @member {CertificateType} certificateType Type of certificate used. + * Possible values include: 'Shared', 'Dedicated' + */ + certificateType: CertificateType; +} + +/** + * @interface + * An interface representing CdnManagedHttpsParameters. + * Defines the certificate source parameters using CDN managed certificate for + * enabling SSL. + * + */ +export interface CdnManagedHttpsParameters { + /** + * @member {string} certificateSource Polymorphic Discriminator + */ + certificateSource: "Cdn"; + /** + * @member {ProtocolType} protocolType Defines the TLS extension protocol + * that is used for secure delivery. Possible values include: + * 'ServerNameIndication', 'IPBased' + */ + protocolType: ProtocolType; + /** + * @member {CdnCertificateSourceParameters} certificateSourceParameters + * Defines the certificate source parameters using CDN managed certificate + * for enabling SSL. + */ + certificateSourceParameters: CdnCertificateSourceParameters; +} + +/** + * @interface + * An interface representing KeyVaultCertificateSourceParameters. + * Describes the parameters for using a user's KeyVault certificate for + * securing custom domain. + * + */ +export interface KeyVaultCertificateSourceParameters { + /** + * @member {string} subscriptionId Subscription Id of the user's Key Vault + * containing the SSL certificate + */ + subscriptionId: string; + /** + * @member {string} resourceGroupName Resource group of the user's Key Vault + * containing the SSL certificate + */ + resourceGroupName: string; + /** + * @member {string} vaultName The name of the user's Key Vault containing the + * SSL certificate + */ + vaultName: string; + /** + * @member {string} secretName The name of Key Vault Secret (representing the + * full certificate PFX) in Key Vault. + */ + secretName: string; + /** + * @member {string} secretVersion The version(GUID) of Key Vault Secret in + * Key Vault. + */ + secretVersion: string; +} + +/** + * @interface + * An interface representing UserManagedHttpsParameters. + * Defines the certificate source parameters using user's keyvault certificate + * for enabling SSL. + * + */ +export interface UserManagedHttpsParameters { + /** + * @member {string} certificateSource Polymorphic Discriminator + */ + certificateSource: "AzureKeyVault"; + /** + * @member {ProtocolType} protocolType Defines the TLS extension protocol + * that is used for secure delivery. Possible values include: + * 'ServerNameIndication', 'IPBased' + */ + protocolType: ProtocolType; + /** + * @member {KeyVaultCertificateSourceParameters} certificateSourceParameters + * Defines the certificate source parameters using user's keyvault + * certificate for enabling SSL. + */ + certificateSourceParameters: KeyVaultCertificateSourceParameters; +} + +/** + * @interface + * An interface representing ValidateCustomDomainInput. + * Input of the custom domain to be validated for DNS mapping. + * + */ +export interface ValidateCustomDomainInput { + /** + * @member {string} hostName The host name of the custom domain. Must be a + * domain name. + */ + hostName: string; +} + +/** + * @interface + * An interface representing ValidateCustomDomainOutput. + * Output of custom domain validation. + * + */ +export interface ValidateCustomDomainOutput { + /** + * @member {boolean} [customDomainValidated] Indicates whether the custom + * domain is valid or not. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly customDomainValidated?: boolean; + /** + * @member {string} [reason] The reason why the custom domain is not valid. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly reason?: string; + /** + * @member {string} [message] Error message describing why the custom domain + * is not valid. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing CheckNameAvailabilityInput. + * Input of CheckNameAvailability API. + * + */ +export interface CheckNameAvailabilityInput { + /** + * @member {string} name The resource name to validate. + */ + name: string; +} + +/** + * @interface + * An interface representing CheckNameAvailabilityOutput. + * Output of check name availability API. + * + */ +export interface CheckNameAvailabilityOutput { + /** + * @member {boolean} [nameAvailable] Indicates whether the name is available. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nameAvailable?: boolean; + /** + * @member {string} [reason] The reason why the name is not available. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly reason?: string; + /** + * @member {string} [message] The detailed error message describing why the + * name is not available. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing ValidateProbeInput. + * Input of the validate probe API. + * + */ +export interface ValidateProbeInput { + /** + * @member {string} probeURL The probe URL to validate. + */ + probeURL: string; +} + +/** + * @interface + * An interface representing ValidateProbeOutput. + * Output of the validate probe API. + * + */ +export interface ValidateProbeOutput { + /** + * @member {boolean} [isValid] Indicates whether the probe URL is accepted or + * not. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly isValid?: boolean; + /** + * @member {string} [errorCode] Specifies the error code when the probe url + * is not accepted. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly errorCode?: string; + /** + * @member {string} [message] The detailed error message describing why the + * probe URL is not accepted. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing ResourceUsage. + * Output of check resource usage API. + * + */ +export interface ResourceUsage { + /** + * @member {string} [resourceType] Resource type for which the usage is + * provided. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceType?: string; + /** + * @member {string} [unit] 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; + /** + * @member {number} [currentValue] Actual value of usage on the specified + * resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly currentValue?: number; + /** + * @member {number} [limit] Quota of the specified resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly limit?: number; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft.Cdn + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resource?: string; + /** + * @member {string} [operation] Operation type: Read, write, delete, etc. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly operation?: string; +} + +/** + * @interface + * An interface representing Operation. + * CDN REST API operation + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing CidrIpAddress. + * CIDR Ip address + * + */ +export interface CidrIpAddress { + /** + * @member {string} [baseIpAddress] Ip address itself. + */ + baseIpAddress?: string; + /** + * @member {number} [prefixLength] The length of the prefix of the ip + * address. + */ + prefixLength?: number; +} + +/** + * @interface + * An interface representing IpAddressGroup. + * CDN Ip address group + * + */ +export interface IpAddressGroup { + /** + * @member {string} [deliveryRegion] The delivery region of the ip address + * group + */ + deliveryRegion?: string; + /** + * @member {CidrIpAddress[]} [ipv4Addresses] The list of ip v4 addresses. + */ + ipv4Addresses?: CidrIpAddress[]; + /** + * @member {CidrIpAddress[]} [ipv6Addresses] The list of ip v6 addresses. + */ + ipv6Addresses?: CidrIpAddress[]; +} + +/** + * @interface + * An interface representing EdgeNode. + * Edgenode is a global Point of Presence (POP) location used to deliver CDN + * content to end users. + * + * @extends ProxyResource + */ +export interface EdgeNode extends ProxyResource { + /** + * @member {IpAddressGroup[]} ipAddressGroups List of ip address groups. + */ + ipAddressGroups: IpAddressGroup[]; +} + +/** + * @interface + * An interface representing ErrorResponse. + * Error response indicates CDN service is not able to process the incoming + * request. The reason is provided in the error message. + * + */ +export interface ErrorResponse { + /** + * @member {string} [code] Error code. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly code?: string; + /** + * @member {string} [message] Error message indicating why the operation + * failed. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing ProfilesUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ProfilesUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {{ [propertyName: string]: string }} [tags] Profile tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ProfilesBeginUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ProfilesBeginUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {{ [propertyName: string]: string }} [tags] Profile tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing CustomDomainsEnableCustomHttpsOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface CustomDomainsEnableCustomHttpsOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {CustomDomainHttpsParametersUnion} [customDomainHttpsParameters] + * 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; +} + +/** + * @interface + * An interface representing CdnManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface CdnManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the ProfileListResult. + * Result of the request to list profiles. It contains a list of profile + * objects and a URL link to get the next set of results. + * + * @extends Array + */ +export interface ProfileListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of profile objects if + * there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ResourceUsageListResult. + * Output of check resource usage API. + * + * @extends Array + */ +export interface ResourceUsageListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of custom domain + * objects if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the EndpointListResult. + * Result of the request to list endpoints. It contains a list of endpoint + * objects and a URL link to get the next set of results. + * + * @extends Array + */ +export interface EndpointListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of endpoint objects if + * there is any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the OriginListResult. + * Result of the request to list origins. It contains a list of origin objects + * and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OriginListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of origin objects if + * there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the CustomDomainListResult. + * Result of the request to list custom domains. It contains a list of custom + * domain objects and a URL link to get the next set of results. + * + * @extends Array + */ +export interface CustomDomainListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of custom domain + * objects if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the OperationsListResult. + * Result of the request to list CDN operations. It contains a list of + * operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationsListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the EdgenodeResult. + * Result of the request to list CDN edgenodes. It contains a list of ip + * address group and a URL link to get the next set of results. + * + * @extends Array + */ +export interface EdgenodeResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of edgenode list + * results if there are any. + */ + nextLink?: string; +} + +/** + * Defines values for SkuName. + * Possible values include: 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon', + * 'Standard_Akamai', 'Standard_ChinaCdn', 'Standard_Microsoft' + * @readonly + * @enum {string} + */ +export type SkuName = 'Standard_Verizon' | 'Premium_Verizon' | 'Custom_Verizon' | 'Standard_Akamai' | 'Standard_ChinaCdn' | 'Standard_Microsoft'; + +/** + * Defines values for ProfileResourceState. + * Possible values include: 'Creating', 'Active', 'Deleting', 'Disabled' + * @readonly + * @enum {string} + */ +export type ProfileResourceState = 'Creating' | 'Active' | 'Deleting' | 'Disabled'; + +/** + * Defines values for OptimizationType. + * Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', + * 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration' + * @readonly + * @enum {string} + */ +export type OptimizationType = 'GeneralWebDelivery' | 'GeneralMediaStreaming' | 'VideoOnDemandMediaStreaming' | 'LargeFileDownload' | 'DynamicSiteAcceleration'; + +/** + * Defines values for EndpointResourceState. + * Possible values include: 'Creating', 'Deleting', 'Running', 'Starting', 'Stopped', 'Stopping' + * @readonly + * @enum {string} + */ +export type EndpointResourceState = 'Creating' | 'Deleting' | 'Running' | 'Starting' | 'Stopped' | 'Stopping'; + +/** + * Defines values for QueryStringCachingBehavior. + * Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet' + * @readonly + * @enum {string} + */ +export type QueryStringCachingBehavior = 'IgnoreQueryString' | 'BypassCaching' | 'UseQueryString' | 'NotSet'; + +/** + * Defines values for GeoFilterActions. + * Possible values include: 'Block', 'Allow' + * @readonly + * @enum {string} + */ +export type GeoFilterActions = 'Block' | 'Allow'; + +/** + * Defines values for RemoteAddressOperator. + * Possible values include: 'Any', 'IPMatch', 'GeoMatch' + * @readonly + * @enum {string} + */ +export type RemoteAddressOperator = 'Any' | 'IPMatch' | 'GeoMatch'; + +/** + * Defines values for Transform. + * Possible values include: 'Lowercase', 'Uppercase' + * @readonly + * @enum {string} + */ +export type Transform = 'Lowercase' | 'Uppercase'; + +/** + * Defines values for QueryStringOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type QueryStringOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for PostArgsOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type PostArgsOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for RequestUriOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type RequestUriOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for RequestHeaderOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type RequestHeaderOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for RequestBodyOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type RequestBodyOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for UrlPathOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual', 'Wildcard' + * @readonly + * @enum {string} + */ +export type UrlPathOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual' | 'Wildcard'; + +/** + * Defines values for UrlFileExtensionOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type UrlFileExtensionOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for UrlFileNameOperator. + * Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', + * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + * @readonly + * @enum {string} + */ +export type UrlFileNameOperator = 'Any' | 'Equal' | 'Contains' | 'BeginsWith' | 'EndsWith' | 'LessThan' | 'LessThanOrEqual' | 'GreaterThan' | 'GreaterThanOrEqual'; + +/** + * Defines values for RedirectType. + * Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' + * @readonly + * @enum {string} + */ +export type RedirectType = 'Moved' | 'Found' | 'TemporaryRedirect' | 'PermanentRedirect'; + +/** + * Defines values for DestinationProtocol. + * Possible values include: 'MatchRequest', 'Http', 'Https' + * @readonly + * @enum {string} + */ +export type DestinationProtocol = 'MatchRequest' | 'Http' | 'Https'; + +/** + * Defines values for HeaderAction. + * Possible values include: 'Append', 'Overwrite', 'Delete' + * @readonly + * @enum {string} + */ +export type HeaderAction = 'Append' | 'Overwrite' | 'Delete'; + +/** + * Defines values for CacheBehavior. + * Possible values include: 'BypassCache', 'Override', 'SetIfMissing' + * @readonly + * @enum {string} + */ +export type CacheBehavior = 'BypassCache' | 'Override' | 'SetIfMissing'; + +/** + * Defines values for OriginResourceState. + * Possible values include: 'Creating', 'Active', 'Deleting' + * @readonly + * @enum {string} + */ +export type OriginResourceState = 'Creating' | 'Active' | 'Deleting'; + +/** + * Defines values for CustomDomainResourceState. + * Possible values include: 'Creating', 'Active', 'Deleting' + * @readonly + * @enum {string} + */ +export type CustomDomainResourceState = 'Creating' | 'Active' | 'Deleting'; + +/** + * Defines values for CustomHttpsProvisioningState. + * Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed' + * @readonly + * @enum {string} + */ +export type CustomHttpsProvisioningState = 'Enabling' | 'Enabled' | 'Disabling' | 'Disabled' | 'Failed'; + +/** + * Defines values for CustomHttpsProvisioningSubstate. + * Possible values include: 'SubmittingDomainControlValidationRequest', + * 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', + * 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', + * 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + * 'CertificateDeleted' + * @readonly + * @enum {string} + */ +export type CustomHttpsProvisioningSubstate = 'SubmittingDomainControlValidationRequest' | 'PendingDomainControlValidationREquestApproval' | 'DomainControlValidationRequestApproved' | 'DomainControlValidationRequestRejected' | 'DomainControlValidationRequestTimedOut' | 'IssuingCertificate' | 'DeployingCertificate' | 'CertificateDeployed' | 'DeletingCertificate' | 'CertificateDeleted'; + +/** + * Defines values for ProtocolType. + * Possible values include: 'ServerNameIndication', 'IPBased' + * @readonly + * @enum {string} + */ +export type ProtocolType = 'ServerNameIndication' | 'IPBased'; + +/** + * Defines values for CertificateType. + * Possible values include: 'Shared', 'Dedicated' + * @readonly + * @enum {string} + */ +export type CertificateType = 'Shared' | 'Dedicated'; + +/** + * Defines values for ResourceType. + * Possible values include: 'Microsoft.Cdn/Profiles/Endpoints' + * @readonly + * @enum {string} + */ +export type ResourceType = 'Microsoft.Cdn/Profiles/Endpoints'; + +/** + * Contains response data for the list operation. + */ +export type ProfilesListResponse = ProfileListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProfileListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ProfilesListByResourceGroupResponse = ProfileListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProfileListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ProfilesGetResponse = Profile & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Profile; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ProfilesCreateResponse = Profile & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Profile; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ProfilesUpdateResponse = Profile & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Profile; + }; +}; + +/** + * Contains response data for the generateSsoUri operation. + */ +export type ProfilesGenerateSsoUriResponse = SsoUri & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SsoUri; + }; +}; + +/** + * Contains response data for the listSupportedOptimizationTypes operation. + */ +export type ProfilesListSupportedOptimizationTypesResponse = SupportedOptimizationTypesListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SupportedOptimizationTypesListResult; + }; +}; + +/** + * Contains response data for the listResourceUsage operation. + */ +export type ProfilesListResourceUsageResponse = ResourceUsageListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceUsageListResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type ProfilesBeginCreateResponse = Profile & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Profile; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ProfilesBeginUpdateResponse = Profile & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Profile; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ProfilesListNextResponse = ProfileListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProfileListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type ProfilesListByResourceGroupNextResponse = ProfileListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProfileListResult; + }; +}; + +/** + * Contains response data for the listResourceUsageNext operation. + */ +export type ProfilesListResourceUsageNextResponse = ResourceUsageListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceUsageListResult; + }; +}; + +/** + * Contains response data for the listByProfile operation. + */ +export type EndpointsListByProfileResponse = EndpointListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EndpointListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type EndpointsGetResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type EndpointsCreateResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type EndpointsUpdateResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the start operation. + */ +export type EndpointsStartResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the stop operation. + */ +export type EndpointsStopResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the validateCustomDomain operation. + */ +export type EndpointsValidateCustomDomainResponse = ValidateCustomDomainOutput & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ValidateCustomDomainOutput; + }; +}; + +/** + * Contains response data for the listResourceUsage operation. + */ +export type EndpointsListResourceUsageResponse = ResourceUsageListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceUsageListResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type EndpointsBeginCreateResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type EndpointsBeginUpdateResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the beginStart operation. + */ +export type EndpointsBeginStartResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the beginStop operation. + */ +export type EndpointsBeginStopResponse = Endpoint & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Endpoint; + }; +}; + +/** + * Contains response data for the listByProfileNext operation. + */ +export type EndpointsListByProfileNextResponse = EndpointListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EndpointListResult; + }; +}; + +/** + * Contains response data for the listResourceUsageNext operation. + */ +export type EndpointsListResourceUsageNextResponse = ResourceUsageListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceUsageListResult; + }; +}; + +/** + * Contains response data for the listByEndpoint operation. + */ +export type OriginsListByEndpointResponse = OriginListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OriginListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type OriginsGetResponse = Origin & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Origin; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type OriginsUpdateResponse = Origin & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Origin; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type OriginsBeginUpdateResponse = Origin & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Origin; + }; +}; + +/** + * Contains response data for the listByEndpointNext operation. + */ +export type OriginsListByEndpointNextResponse = OriginListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OriginListResult; + }; +}; + +/** + * Contains response data for the listByEndpoint operation. + */ +export type CustomDomainsListByEndpointResponse = CustomDomainListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomainListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CustomDomainsGetResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type CustomDomainsCreateResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type CustomDomainsDeleteMethodResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the disableCustomHttps operation. + */ +export type CustomDomainsDisableCustomHttpsResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the enableCustomHttps operation. + */ +export type CustomDomainsEnableCustomHttpsResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type CustomDomainsBeginCreateResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the beginDeleteMethod operation. + */ +export type CustomDomainsBeginDeleteMethodResponse = CustomDomain & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomain; + }; +}; + +/** + * Contains response data for the listByEndpointNext operation. + */ +export type CustomDomainsListByEndpointNextResponse = CustomDomainListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomDomainListResult; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type CheckNameAvailabilityResponse = CheckNameAvailabilityOutput & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CheckNameAvailabilityOutput; + }; +}; + +/** + * Contains response data for the checkNameAvailabilityWithSubscription operation. + */ +export type CheckNameAvailabilityWithSubscriptionResponse = CheckNameAvailabilityOutput & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CheckNameAvailabilityOutput; + }; +}; + +/** + * Contains response data for the validateProbe operation. + */ +export type ValidateProbeResponse = ValidateProbeOutput & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ValidateProbeOutput; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ResourceUsageListResponse = ResourceUsageListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceUsageListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ResourceUsageListNextResponse = ResourceUsageListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceUsageListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationsListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationsListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type EdgeNodesListResponse = EdgenodeResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EdgenodeResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type EdgeNodesListNextResponse = EdgenodeResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EdgenodeResult; + }; +}; diff --git a/sdk/cdn/arm-cdn/lib/models/mappers.ts b/sdk/cdn/arm-cdn/lib/models/mappers.ts new file mode 100644 index 000000000000..397daadcd155 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/mappers.ts @@ -0,0 +1,2737 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Profile: msRest.CompositeMapper = { + serializedName: "Profile", + type: { + name: "Composite", + className: "Profile", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const ProfileUpdateParameters: msRest.CompositeMapper = { + serializedName: "ProfileUpdateParameters", + type: { + name: "Composite", + className: "ProfileUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SsoUri: msRest.CompositeMapper = { + serializedName: "SsoUri", + type: { + name: "Composite", + className: "SsoUri", + modelProperties: { + ssoUriValue: { + readOnly: true, + serializedName: "ssoUriValue", + type: { + name: "String" + } + } + } + } +}; + +export const SupportedOptimizationTypesListResult: msRest.CompositeMapper = { + serializedName: "SupportedOptimizationTypesListResult", + type: { + name: "Composite", + className: "SupportedOptimizationTypesListResult", + modelProperties: { + supportedOptimizationTypes: { + readOnly: true, + serializedName: "supportedOptimizationTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeepCreatedOrigin: msRest.CompositeMapper = { + serializedName: "DeepCreatedOrigin", + type: { + name: "Composite", + className: "DeepCreatedOrigin", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + hostName: { + required: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + httpPort: { + serializedName: "properties.httpPort", + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + httpsPort: { + serializedName: "properties.httpsPort", + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const Endpoint: msRest.CompositeMapper = { + serializedName: "Endpoint", + type: { + name: "Composite", + className: "Endpoint", + modelProperties: { + ...TrackedResource.type.modelProperties, + originHostHeader: { + serializedName: "properties.originHostHeader", + type: { + name: "String" + } + }, + originPath: { + serializedName: "properties.originPath", + type: { + name: "String" + } + }, + contentTypesToCompress: { + serializedName: "properties.contentTypesToCompress", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + isCompressionEnabled: { + serializedName: "properties.isCompressionEnabled", + type: { + name: "Boolean" + } + }, + isHttpAllowed: { + serializedName: "properties.isHttpAllowed", + type: { + name: "Boolean" + } + }, + isHttpsAllowed: { + serializedName: "properties.isHttpsAllowed", + type: { + name: "Boolean" + } + }, + queryStringCachingBehavior: { + serializedName: "properties.queryStringCachingBehavior", + type: { + name: "Enum", + allowedValues: [ + "IgnoreQueryString", + "BypassCaching", + "UseQueryString", + "NotSet" + ] + } + }, + optimizationType: { + serializedName: "properties.optimizationType", + type: { + name: "String" + } + }, + probePath: { + serializedName: "properties.probePath", + type: { + name: "String" + } + }, + geoFilters: { + serializedName: "properties.geoFilters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GeoFilter" + } + } + } + }, + deliveryPolicy: { + serializedName: "properties.deliveryPolicy", + type: { + name: "Composite", + className: "EndpointPropertiesUpdateParametersDeliveryPolicy" + } + }, + hostName: { + readOnly: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + origins: { + required: true, + serializedName: "properties.origins", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeepCreatedOrigin" + } + } + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const GeoFilter: msRest.CompositeMapper = { + serializedName: "GeoFilter", + type: { + name: "Composite", + className: "GeoFilter", + modelProperties: { + relativePath: { + required: true, + serializedName: "relativePath", + type: { + name: "String" + } + }, + action: { + required: true, + serializedName: "action", + type: { + name: "Enum", + allowedValues: [ + "Block", + "Allow" + ] + } + }, + countryCodes: { + required: true, + serializedName: "countryCodes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleCondition: msRest.CompositeMapper = { + serializedName: "DeliveryRuleCondition", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "name", + clientName: "name" + }, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleCondition", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const DeliveryRuleAction: msRest.CompositeMapper = { + serializedName: "DeliveryRuleAction", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "name", + clientName: "name" + }, + uberParent: "DeliveryRuleAction", + className: "DeliveryRuleAction", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const DeliveryRule: msRest.CompositeMapper = { + serializedName: "DeliveryRule", + type: { + name: "Composite", + className: "DeliveryRule", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + order: { + required: true, + serializedName: "order", + type: { + name: "Number" + } + }, + conditions: { + serializedName: "conditions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeliveryRuleCondition" + } + } + } + }, + actions: { + required: true, + serializedName: "actions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeliveryRuleAction" + } + } + } + } + } + } +}; + +export const EndpointPropertiesUpdateParametersDeliveryPolicy: msRest.CompositeMapper = { + serializedName: "EndpointPropertiesUpdateParameters_deliveryPolicy", + type: { + name: "Composite", + className: "EndpointPropertiesUpdateParametersDeliveryPolicy", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + }, + rules: { + required: true, + serializedName: "rules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeliveryRule" + } + } + } + } + } + } +}; + +export const EndpointUpdateParameters: msRest.CompositeMapper = { + serializedName: "EndpointUpdateParameters", + type: { + name: "Composite", + className: "EndpointUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + originHostHeader: { + serializedName: "properties.originHostHeader", + type: { + name: "String" + } + }, + originPath: { + serializedName: "properties.originPath", + type: { + name: "String" + } + }, + contentTypesToCompress: { + serializedName: "properties.contentTypesToCompress", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + isCompressionEnabled: { + serializedName: "properties.isCompressionEnabled", + type: { + name: "Boolean" + } + }, + isHttpAllowed: { + serializedName: "properties.isHttpAllowed", + type: { + name: "Boolean" + } + }, + isHttpsAllowed: { + serializedName: "properties.isHttpsAllowed", + type: { + name: "Boolean" + } + }, + queryStringCachingBehavior: { + serializedName: "properties.queryStringCachingBehavior", + type: { + name: "Enum", + allowedValues: [ + "IgnoreQueryString", + "BypassCaching", + "UseQueryString", + "NotSet" + ] + } + }, + optimizationType: { + serializedName: "properties.optimizationType", + type: { + name: "String" + } + }, + probePath: { + serializedName: "properties.probePath", + type: { + name: "String" + } + }, + geoFilters: { + serializedName: "properties.geoFilters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GeoFilter" + } + } + } + }, + deliveryPolicy: { + serializedName: "properties.deliveryPolicy", + type: { + name: "Composite", + className: "EndpointPropertiesUpdateParametersDeliveryPolicy" + } + } + } + } +}; + +export const RemoteAddressMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "RemoteAddressMatchConditionParameters", + type: { + name: "Composite", + className: "RemoteAddressMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleRemoteAddressCondition: msRest.CompositeMapper = { + serializedName: "RemoteAddress", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleRemoteAddressCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "RemoteAddressMatchConditionParameters" + } + } + } + } +}; + +export const RequestMethodMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "RequestMethodMatchConditionParameters", + type: { + name: "Composite", + className: "RequestMethodMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + isConstant: true, + serializedName: "operator", + defaultValue: 'Equal', + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleRequestMethodCondition: msRest.CompositeMapper = { + serializedName: "RequestMethod", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleRequestMethodCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "RequestMethodMatchConditionParameters" + } + } + } + } +}; + +export const QueryStringMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "QueryStringMatchConditionParameters", + type: { + name: "Composite", + className: "QueryStringMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleQueryStringCondition: msRest.CompositeMapper = { + serializedName: "QueryString", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleQueryStringCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "QueryStringMatchConditionParameters" + } + } + } + } +}; + +export const PostArgsMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "PostArgsMatchConditionParameters", + type: { + name: "Composite", + className: "PostArgsMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters', + type: { + name: "String" + } + }, + selector: { + required: true, + serializedName: "selector", + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRulePostArgsCondition: msRest.CompositeMapper = { + serializedName: "PostArgs", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRulePostArgsCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "PostArgsMatchConditionParameters" + } + } + } + } +}; + +export const RequestUriMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "RequestUriMatchConditionParameters", + type: { + name: "Composite", + className: "RequestUriMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleRequestUriCondition: msRest.CompositeMapper = { + serializedName: "RequestUri", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleRequestUriCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "RequestUriMatchConditionParameters" + } + } + } + } +}; + +export const RequestHeaderMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "RequestHeaderMatchConditionParameters", + type: { + name: "Composite", + className: "RequestHeaderMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters', + type: { + name: "String" + } + }, + selector: { + required: true, + serializedName: "selector", + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleRequestHeaderCondition: msRest.CompositeMapper = { + serializedName: "RequestHeader", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleRequestHeaderCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "RequestHeaderMatchConditionParameters" + } + } + } + } +}; + +export const RequestBodyMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "RequestBodyMatchConditionParameters", + type: { + name: "Composite", + className: "RequestBodyMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleRequestBodyCondition: msRest.CompositeMapper = { + serializedName: "RequestBody", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleRequestBodyCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "RequestBodyMatchConditionParameters" + } + } + } + } +}; + +export const RequestSchemeMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "RequestSchemeMatchConditionParameters", + type: { + name: "Composite", + className: "RequestSchemeMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + isConstant: true, + serializedName: "operator", + defaultValue: 'Equal', + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleRequestSchemeCondition: msRest.CompositeMapper = { + serializedName: "RequestScheme", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleRequestSchemeCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "RequestSchemeMatchConditionParameters" + } + } + } + } +}; + +export const UrlPathMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "UrlPathMatchConditionParameters", + type: { + name: "Composite", + className: "UrlPathMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathMatchConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleUrlPathCondition: msRest.CompositeMapper = { + serializedName: "UrlPath", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleUrlPathCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "UrlPathMatchConditionParameters" + } + } + } + } +}; + +export const UrlFileExtensionMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "UrlFileExtensionMatchConditionParameters", + type: { + name: "Composite", + className: "UrlFileExtensionMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionMatchConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleUrlFileExtensionCondition: msRest.CompositeMapper = { + serializedName: "UrlFileExtension", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleUrlFileExtensionCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "UrlFileExtensionMatchConditionParameters" + } + } + } + } +}; + +export const UrlFileNameMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "UrlFileNameMatchConditionParameters", + type: { + name: "Composite", + className: "UrlFileNameMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFilenameConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + serializedName: "operator", + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleUrlFileNameCondition: msRest.CompositeMapper = { + serializedName: "UrlFileName", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleUrlFileNameCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "UrlFileNameMatchConditionParameters" + } + } + } + } +}; + +export const IsDeviceMatchConditionParameters: msRest.CompositeMapper = { + serializedName: "IsDeviceMatchConditionParameters", + type: { + name: "Composite", + className: "IsDeviceMatchConditionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters', + type: { + name: "String" + } + }, + operator: { + required: true, + isConstant: true, + serializedName: "operator", + defaultValue: 'Equal', + type: { + name: "String" + } + }, + negateCondition: { + serializedName: "negateCondition", + type: { + name: "Boolean" + } + }, + matchValues: { + required: true, + serializedName: "matchValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transforms: { + serializedName: "transforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeliveryRuleIsDeviceCondition: msRest.CompositeMapper = { + serializedName: "IsDevice", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleCondition.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleCondition", + className: "DeliveryRuleIsDeviceCondition", + modelProperties: { + ...DeliveryRuleCondition.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "IsDeviceMatchConditionParameters" + } + } + } + } +}; + +export const UrlRedirectActionParameters: msRest.CompositeMapper = { + serializedName: "UrlRedirectActionParameters", + type: { + name: "Composite", + className: "UrlRedirectActionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRedirectActionParameters', + type: { + name: "String" + } + }, + redirectType: { + required: true, + serializedName: "redirectType", + type: { + name: "String" + } + }, + destinationProtocol: { + serializedName: "destinationProtocol", + type: { + name: "String" + } + }, + customPath: { + serializedName: "customPath", + type: { + name: "String" + } + }, + customHostname: { + serializedName: "customHostname", + type: { + name: "String" + } + }, + customQueryString: { + serializedName: "customQueryString", + type: { + name: "String" + } + }, + customFragment: { + serializedName: "customFragment", + type: { + name: "String" + } + } + } + } +}; + +export const UrlRedirectAction: msRest.CompositeMapper = { + serializedName: "UrlRedirect", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleAction.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleAction", + className: "UrlRedirectAction", + modelProperties: { + ...DeliveryRuleAction.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "UrlRedirectActionParameters" + } + } + } + } +}; + +export const HeaderActionParameters: msRest.CompositeMapper = { + serializedName: "HeaderActionParameters", + type: { + name: "Composite", + className: "HeaderActionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters', + type: { + name: "String" + } + }, + headerAction: { + required: true, + serializedName: "headerAction", + type: { + name: "String" + } + }, + headerName: { + required: true, + serializedName: "headerName", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const DeliveryRuleRequestHeaderAction: msRest.CompositeMapper = { + serializedName: "ModifyRequestHeader", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleAction.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleAction", + className: "DeliveryRuleRequestHeaderAction", + modelProperties: { + ...DeliveryRuleAction.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "HeaderActionParameters" + } + } + } + } +}; + +export const DeliveryRuleResponseHeaderAction: msRest.CompositeMapper = { + serializedName: "ModifyResponseHeader", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleAction.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleAction", + className: "DeliveryRuleResponseHeaderAction", + modelProperties: { + ...DeliveryRuleAction.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "HeaderActionParameters" + } + } + } + } +}; + +export const CacheExpirationActionParameters: msRest.CompositeMapper = { + serializedName: "CacheExpirationActionParameters", + type: { + name: "Composite", + className: "CacheExpirationActionParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters', + type: { + name: "String" + } + }, + cacheBehavior: { + required: true, + serializedName: "cacheBehavior", + type: { + name: "String" + } + }, + cacheType: { + required: true, + isConstant: true, + serializedName: "cacheType", + defaultValue: 'All', + type: { + name: "String" + } + }, + cacheDuration: { + nullable: true, + serializedName: "cacheDuration", + type: { + name: "String" + } + } + } + } +}; + +export const DeliveryRuleCacheExpirationAction: msRest.CompositeMapper = { + serializedName: "CacheExpiration", + type: { + name: "Composite", + polymorphicDiscriminator: DeliveryRuleAction.type.polymorphicDiscriminator, + uberParent: "DeliveryRuleAction", + className: "DeliveryRuleCacheExpirationAction", + modelProperties: { + ...DeliveryRuleAction.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + defaultValue: {}, + type: { + name: "Composite", + className: "CacheExpirationActionParameters" + } + } + } + } +}; + +export const PurgeParameters: msRest.CompositeMapper = { + serializedName: "PurgeParameters", + type: { + name: "Composite", + className: "PurgeParameters", + modelProperties: { + contentPaths: { + required: true, + serializedName: "contentPaths", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const LoadParameters: msRest.CompositeMapper = { + serializedName: "LoadParameters", + type: { + name: "Composite", + className: "LoadParameters", + modelProperties: { + contentPaths: { + required: true, + serializedName: "contentPaths", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Origin: msRest.CompositeMapper = { + serializedName: "Origin", + type: { + name: "Composite", + className: "Origin", + modelProperties: { + ...TrackedResource.type.modelProperties, + hostName: { + required: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + httpPort: { + serializedName: "properties.httpPort", + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + httpsPort: { + serializedName: "properties.httpsPort", + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const OriginUpdateParameters: msRest.CompositeMapper = { + serializedName: "OriginUpdateParameters", + type: { + name: "Composite", + className: "OriginUpdateParameters", + modelProperties: { + hostName: { + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + httpPort: { + serializedName: "properties.httpPort", + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + httpsPort: { + serializedName: "properties.httpsPort", + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const CustomDomain: msRest.CompositeMapper = { + serializedName: "CustomDomain", + type: { + name: "Composite", + className: "CustomDomain", + modelProperties: { + ...ProxyResource.type.modelProperties, + hostName: { + required: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + customHttpsProvisioningState: { + readOnly: true, + serializedName: "properties.customHttpsProvisioningState", + type: { + name: "String" + } + }, + customHttpsProvisioningSubstate: { + readOnly: true, + serializedName: "properties.customHttpsProvisioningSubstate", + type: { + name: "String" + } + }, + validationData: { + serializedName: "properties.validationData", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const CustomDomainParameters: msRest.CompositeMapper = { + serializedName: "CustomDomainParameters", + type: { + name: "Composite", + className: "CustomDomainParameters", + modelProperties: { + hostName: { + required: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + } + } + } +}; + +export const CustomDomainHttpsParameters: msRest.CompositeMapper = { + serializedName: "CustomDomainHttpsParameters", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "certificateSource", + clientName: "certificateSource" + }, + uberParent: "CustomDomainHttpsParameters", + className: "CustomDomainHttpsParameters", + modelProperties: { + protocolType: { + required: true, + serializedName: "protocolType", + type: { + name: "String" + } + }, + certificateSource: { + required: true, + serializedName: "certificateSource", + type: { + name: "String" + } + } + } + } +}; + +export const CdnCertificateSourceParameters: msRest.CompositeMapper = { + serializedName: "CdnCertificateSourceParameters", + type: { + name: "Composite", + className: "CdnCertificateSourceParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters', + type: { + name: "String" + } + }, + certificateType: { + required: true, + serializedName: "certificateType", + type: { + name: "String" + } + } + } + } +}; + +export const CdnManagedHttpsParameters: msRest.CompositeMapper = { + serializedName: "Cdn", + type: { + name: "Composite", + polymorphicDiscriminator: CustomDomainHttpsParameters.type.polymorphicDiscriminator, + uberParent: "CustomDomainHttpsParameters", + className: "CdnManagedHttpsParameters", + modelProperties: { + ...CustomDomainHttpsParameters.type.modelProperties, + certificateSourceParameters: { + required: true, + serializedName: "certificateSourceParameters", + defaultValue: {}, + type: { + name: "Composite", + className: "CdnCertificateSourceParameters" + } + } + } + } +}; + +export const KeyVaultCertificateSourceParameters: msRest.CompositeMapper = { + serializedName: "KeyVaultCertificateSourceParameters", + type: { + name: "Composite", + className: "KeyVaultCertificateSourceParameters", + modelProperties: { + odatatype: { + required: true, + isConstant: true, + serializedName: "@odata\\.type", + defaultValue: '#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters', + type: { + name: "String" + } + }, + subscriptionId: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + resourceGroupName: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + }, + vaultName: { + required: true, + serializedName: "vaultName", + type: { + name: "String" + } + }, + secretName: { + required: true, + serializedName: "secretName", + type: { + name: "String" + } + }, + secretVersion: { + required: true, + serializedName: "secretVersion", + type: { + name: "String" + } + }, + updateRule: { + required: true, + isConstant: true, + serializedName: "updateRule", + defaultValue: 'NoAction', + type: { + name: "String" + } + }, + deleteRule: { + required: true, + isConstant: true, + serializedName: "deleteRule", + defaultValue: 'NoAction', + type: { + name: "String" + } + } + } + } +}; + +export const UserManagedHttpsParameters: msRest.CompositeMapper = { + serializedName: "AzureKeyVault", + type: { + name: "Composite", + polymorphicDiscriminator: CustomDomainHttpsParameters.type.polymorphicDiscriminator, + uberParent: "CustomDomainHttpsParameters", + className: "UserManagedHttpsParameters", + modelProperties: { + ...CustomDomainHttpsParameters.type.modelProperties, + certificateSourceParameters: { + required: true, + serializedName: "certificateSourceParameters", + defaultValue: {}, + type: { + name: "Composite", + className: "KeyVaultCertificateSourceParameters" + } + } + } + } +}; + +export const ValidateCustomDomainInput: msRest.CompositeMapper = { + serializedName: "ValidateCustomDomainInput", + type: { + name: "Composite", + className: "ValidateCustomDomainInput", + modelProperties: { + hostName: { + required: true, + serializedName: "hostName", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateCustomDomainOutput: msRest.CompositeMapper = { + serializedName: "ValidateCustomDomainOutput", + type: { + name: "Composite", + className: "ValidateCustomDomainOutput", + modelProperties: { + customDomainValidated: { + readOnly: true, + serializedName: "customDomainValidated", + type: { + name: "Boolean" + } + }, + reason: { + readOnly: true, + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityInput: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityInput", + type: { + name: "Composite", + className: "CheckNameAvailabilityInput", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'Microsoft.Cdn/Profiles/Endpoints', + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityOutput: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityOutput", + type: { + name: "Composite", + className: "CheckNameAvailabilityOutput", + modelProperties: { + nameAvailable: { + readOnly: true, + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + readOnly: true, + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateProbeInput: msRest.CompositeMapper = { + serializedName: "ValidateProbeInput", + type: { + name: "Composite", + className: "ValidateProbeInput", + modelProperties: { + probeURL: { + required: true, + serializedName: "probeURL", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateProbeOutput: msRest.CompositeMapper = { + serializedName: "ValidateProbeOutput", + type: { + name: "Composite", + className: "ValidateProbeOutput", + modelProperties: { + isValid: { + readOnly: true, + serializedName: "isValid", + type: { + name: "Boolean" + } + }, + errorCode: { + readOnly: true, + serializedName: "errorCode", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceUsage: msRest.CompositeMapper = { + serializedName: "ResourceUsage", + type: { + name: "Composite", + className: "ResourceUsage", + modelProperties: { + resourceType: { + readOnly: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + unit: { + readOnly: true, + serializedName: "unit", + type: { + name: "String" + } + }, + currentValue: { + readOnly: true, + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + readOnly: true, + serializedName: "limit", + type: { + name: "Number" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const CidrIpAddress: msRest.CompositeMapper = { + serializedName: "cidrIpAddress", + type: { + name: "Composite", + className: "CidrIpAddress", + modelProperties: { + baseIpAddress: { + serializedName: "baseIpAddress", + type: { + name: "String" + } + }, + prefixLength: { + serializedName: "prefixLength", + type: { + name: "Number" + } + } + } + } +}; + +export const IpAddressGroup: msRest.CompositeMapper = { + serializedName: "IpAddressGroup", + type: { + name: "Composite", + className: "IpAddressGroup", + modelProperties: { + deliveryRegion: { + serializedName: "deliveryRegion", + type: { + name: "String" + } + }, + ipv4Addresses: { + serializedName: "ipv4Addresses", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CidrIpAddress" + } + } + } + }, + ipv6Addresses: { + serializedName: "ipv6Addresses", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CidrIpAddress" + } + } + } + } + } + } +}; + +export const EdgeNode: msRest.CompositeMapper = { + serializedName: "EdgeNode", + type: { + name: "Composite", + className: "EdgeNode", + modelProperties: { + ...ProxyResource.type.modelProperties, + ipAddressGroups: { + required: true, + serializedName: "properties.ipAddressGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpAddressGroup" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ProfileListResult: msRest.CompositeMapper = { + serializedName: "ProfileListResult", + type: { + name: "Composite", + className: "ProfileListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Profile" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceUsageListResult: msRest.CompositeMapper = { + serializedName: "ResourceUsageListResult", + type: { + name: "Composite", + className: "ResourceUsageListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceUsage" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const EndpointListResult: msRest.CompositeMapper = { + serializedName: "EndpointListResult", + type: { + name: "Composite", + className: "EndpointListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Endpoint" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OriginListResult: msRest.CompositeMapper = { + serializedName: "OriginListResult", + type: { + name: "Composite", + className: "OriginListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Origin" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CustomDomainListResult: msRest.CompositeMapper = { + serializedName: "CustomDomainListResult", + type: { + name: "Composite", + className: "CustomDomainListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomDomain" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationsListResult: msRest.CompositeMapper = { + serializedName: "OperationsListResult", + type: { + name: "Composite", + className: "OperationsListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const EdgenodeResult: msRest.CompositeMapper = { + serializedName: "EdgenodeResult", + type: { + name: "Composite", + className: "EdgenodeResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EdgeNode" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const discriminators = { + 'DeliveryRuleCondition' : DeliveryRuleCondition, + 'DeliveryRuleAction' : DeliveryRuleAction, + 'DeliveryRuleCondition.RemoteAddress' : DeliveryRuleRemoteAddressCondition, + 'DeliveryRuleCondition.RequestMethod' : DeliveryRuleRequestMethodCondition, + 'DeliveryRuleCondition.QueryString' : DeliveryRuleQueryStringCondition, + 'DeliveryRuleCondition.PostArgs' : DeliveryRulePostArgsCondition, + 'DeliveryRuleCondition.RequestUri' : DeliveryRuleRequestUriCondition, + 'DeliveryRuleCondition.RequestHeader' : DeliveryRuleRequestHeaderCondition, + 'DeliveryRuleCondition.RequestBody' : DeliveryRuleRequestBodyCondition, + 'DeliveryRuleCondition.RequestScheme' : DeliveryRuleRequestSchemeCondition, + 'DeliveryRuleCondition.UrlPath' : DeliveryRuleUrlPathCondition, + 'DeliveryRuleCondition.UrlFileExtension' : DeliveryRuleUrlFileExtensionCondition, + 'DeliveryRuleCondition.UrlFileName' : DeliveryRuleUrlFileNameCondition, + 'DeliveryRuleCondition.IsDevice' : DeliveryRuleIsDeviceCondition, + 'DeliveryRuleAction.UrlRedirect' : UrlRedirectAction, + 'DeliveryRuleAction.ModifyRequestHeader' : DeliveryRuleRequestHeaderAction, + 'DeliveryRuleAction.ModifyResponseHeader' : DeliveryRuleResponseHeaderAction, + 'DeliveryRuleAction.CacheExpiration' : DeliveryRuleCacheExpirationAction, + 'CustomDomainHttpsParameters' : CustomDomainHttpsParameters, + 'CustomDomainHttpsParameters.Cdn' : CdnManagedHttpsParameters, + 'CustomDomainHttpsParameters.AzureKeyVault' : UserManagedHttpsParameters +}; diff --git a/sdk/cdn/arm-cdn/lib/models/operationsMappers.ts b/sdk/cdn/arm-cdn/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..106f6ae269a9 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/operationsMappers.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + OperationsListResult, + Operation, + OperationDisplay, + ErrorResponse +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/models/originsMappers.ts b/sdk/cdn/arm-cdn/lib/models/originsMappers.ts new file mode 100644 index 000000000000..9a544df0e020 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/originsMappers.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + OriginListResult, + Origin, + TrackedResource, + Resource, + BaseResource, + ErrorResponse, + OriginUpdateParameters, + Profile, + Sku, + ProfileUpdateParameters, + DeepCreatedOrigin, + Endpoint, + GeoFilter, + EndpointPropertiesUpdateParametersDeliveryPolicy, + DeliveryRule, + DeliveryRuleCondition, + DeliveryRuleAction, + EndpointUpdateParameters, + DeliveryRuleRemoteAddressCondition, + RemoteAddressMatchConditionParameters, + DeliveryRuleRequestMethodCondition, + RequestMethodMatchConditionParameters, + DeliveryRuleQueryStringCondition, + QueryStringMatchConditionParameters, + DeliveryRulePostArgsCondition, + PostArgsMatchConditionParameters, + DeliveryRuleRequestUriCondition, + RequestUriMatchConditionParameters, + DeliveryRuleRequestHeaderCondition, + RequestHeaderMatchConditionParameters, + DeliveryRuleRequestBodyCondition, + RequestBodyMatchConditionParameters, + DeliveryRuleRequestSchemeCondition, + RequestSchemeMatchConditionParameters, + DeliveryRuleUrlPathCondition, + UrlPathMatchConditionParameters, + DeliveryRuleUrlFileExtensionCondition, + UrlFileExtensionMatchConditionParameters, + DeliveryRuleUrlFileNameCondition, + UrlFileNameMatchConditionParameters, + DeliveryRuleIsDeviceCondition, + IsDeviceMatchConditionParameters, + UrlRedirectAction, + UrlRedirectActionParameters, + DeliveryRuleRequestHeaderAction, + HeaderActionParameters, + DeliveryRuleResponseHeaderAction, + DeliveryRuleCacheExpirationAction, + CacheExpirationActionParameters, + ProxyResource, + CustomDomain, + EdgeNode, + IpAddressGroup, + CidrIpAddress +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/models/parameters.ts b/sdk/cdn/arm-cdn/lib/models/parameters.ts new file mode 100644 index 000000000000..dea0816e4379 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/parameters.ts @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const customDomainName: msRest.OperationURLParameter = { + parameterPath: "customDomainName", + mapper: { + required: true, + serializedName: "customDomainName", + type: { + name: "String" + } + } +}; +export const endpointName: msRest.OperationURLParameter = { + parameterPath: "endpointName", + mapper: { + required: true, + serializedName: "endpointName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const originName: msRest.OperationURLParameter = { + parameterPath: "originName", + mapper: { + required: true, + serializedName: "originName", + type: { + name: "String" + } + } +}; +export const profileName: msRest.OperationURLParameter = { + parameterPath: "profileName", + mapper: { + required: true, + serializedName: "profileName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/cdn/arm-cdn/lib/models/profilesMappers.ts b/sdk/cdn/arm-cdn/lib/models/profilesMappers.ts new file mode 100644 index 000000000000..b02b6aecb4aa --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/profilesMappers.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + ProfileListResult, + Profile, + TrackedResource, + Resource, + BaseResource, + Sku, + ErrorResponse, + ProfileUpdateParameters, + SsoUri, + SupportedOptimizationTypesListResult, + ResourceUsageListResult, + ResourceUsage, + DeepCreatedOrigin, + Endpoint, + GeoFilter, + EndpointPropertiesUpdateParametersDeliveryPolicy, + DeliveryRule, + DeliveryRuleCondition, + DeliveryRuleAction, + EndpointUpdateParameters, + DeliveryRuleRemoteAddressCondition, + RemoteAddressMatchConditionParameters, + DeliveryRuleRequestMethodCondition, + RequestMethodMatchConditionParameters, + DeliveryRuleQueryStringCondition, + QueryStringMatchConditionParameters, + DeliveryRulePostArgsCondition, + PostArgsMatchConditionParameters, + DeliveryRuleRequestUriCondition, + RequestUriMatchConditionParameters, + DeliveryRuleRequestHeaderCondition, + RequestHeaderMatchConditionParameters, + DeliveryRuleRequestBodyCondition, + RequestBodyMatchConditionParameters, + DeliveryRuleRequestSchemeCondition, + RequestSchemeMatchConditionParameters, + DeliveryRuleUrlPathCondition, + UrlPathMatchConditionParameters, + DeliveryRuleUrlFileExtensionCondition, + UrlFileExtensionMatchConditionParameters, + DeliveryRuleUrlFileNameCondition, + UrlFileNameMatchConditionParameters, + DeliveryRuleIsDeviceCondition, + IsDeviceMatchConditionParameters, + UrlRedirectAction, + UrlRedirectActionParameters, + DeliveryRuleRequestHeaderAction, + HeaderActionParameters, + DeliveryRuleResponseHeaderAction, + DeliveryRuleCacheExpirationAction, + CacheExpirationActionParameters, + Origin, + OriginUpdateParameters, + ProxyResource, + CustomDomain, + EdgeNode, + IpAddressGroup, + CidrIpAddress +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/models/resourceUsageOperationsMappers.ts b/sdk/cdn/arm-cdn/lib/models/resourceUsageOperationsMappers.ts new file mode 100644 index 000000000000..d291a33629fc --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/models/resourceUsageOperationsMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + ResourceUsageListResult, + ResourceUsage, + ErrorResponse +} from "../models/mappers"; + diff --git a/sdk/cdn/arm-cdn/lib/operations/customDomains.ts b/sdk/cdn/arm-cdn/lib/operations/customDomains.ts new file mode 100644 index 000000000000..83415680c61c --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/customDomains.ts @@ -0,0 +1,498 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/customDomainsMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a CustomDomains. */ +export class CustomDomains { + private readonly client: CdnManagementClientContext; + + /** + * Create a CustomDomains. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the existing custom domains within an endpoint. + * @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 [options] The optional parameters + * @returns Promise + */ + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + listByEndpointOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing custom domain within an endpoint. + * @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 optional parameters + * @returns Promise + */ + get(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + get(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, callback: msRest.ServiceCallback): void; + /** + * @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 optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + customDomainName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new custom domain within an endpoint. + * @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 hostName The host name of the custom domain. Must be a domain name. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, hostName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,profileName,endpointName,customDomainName,hostName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing custom domain within an endpoint. + * @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 optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,profileName,endpointName,customDomainName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * 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 optional parameters + * @returns Promise + */ + disableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + disableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, callback: msRest.ServiceCallback): void; + /** + * @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 optional parameters + * @param callback The callback + */ + disableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + customDomainName, + options + }, + disableCustomHttpsOperationSpec, + callback) as Promise; + } + + /** + * 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 optional parameters + * @returns Promise + */ + enableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: Models.CustomDomainsEnableCustomHttpsOptionalParams): Promise; + /** + * @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 callback The callback + */ + enableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, callback: msRest.ServiceCallback): void; + /** + * @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 optional parameters + * @param callback The callback + */ + enableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options: Models.CustomDomainsEnableCustomHttpsOptionalParams, callback: msRest.ServiceCallback): void; + enableCustomHttps(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: Models.CustomDomainsEnableCustomHttpsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + customDomainName, + options + }, + enableCustomHttpsOperationSpec, + callback) as Promise; + } + + /** + * Creates a new custom domain within an endpoint. + * @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 hostName The host name of the custom domain. Must be a domain name. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, hostName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + customDomainName, + hostName, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes an existing custom domain within an endpoint. + * @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 optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, profileName: string, endpointName: string, customDomainName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + customDomainName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByEndpointNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByEndpointNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByEndpointNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEndpointNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByEndpointNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByEndpointOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomDomainListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.customDomainName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomDomain + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const disableCustomHttpsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.customDomainName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: { + bodyMapper: Mappers.CustomDomain + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const enableCustomHttpsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.customDomainName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "customDomainHttpsParameters" + ], + mapper: Mappers.CustomDomainHttpsParameters + }, + responses: { + 200: {}, + 202: { + bodyMapper: Mappers.CustomDomain + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.customDomainName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + hostName: "hostName" + }, + mapper: { + ...Mappers.CustomDomainParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CustomDomain + }, + 201: { + bodyMapper: Mappers.CustomDomain + }, + 202: { + bodyMapper: Mappers.CustomDomain + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.customDomainName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: { + bodyMapper: Mappers.CustomDomain + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByEndpointNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomDomainListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/lib/operations/edgeNodes.ts b/sdk/cdn/arm-cdn/lib/operations/edgeNodes.ts new file mode 100644 index 000000000000..282fd57f895a --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/edgeNodes.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/edgeNodesMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a EdgeNodes. */ +export class EdgeNodes { + private readonly client: CdnManagementClientContext; + + /** + * Create a EdgeNodes. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end + * users. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end + * users. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Cdn/edgenodes", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EdgenodeResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EdgenodeResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/lib/operations/endpoints.ts b/sdk/cdn/arm-cdn/lib/operations/endpoints.ts new file mode 100644 index 000000000000..d5894f45add5 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/endpoints.ts @@ -0,0 +1,869 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/endpointsMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a Endpoints. */ +export class Endpoints { + private readonly client: CdnManagementClientContext; + + /** + * Create a Endpoints. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Lists existing CDN endpoints. + * @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 [options] The optional parameters + * @returns Promise + */ + listByProfile(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + listByProfile(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + listByProfile(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByProfile(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + options + }, + listByProfileOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * @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 [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + get(resourceGroupName: string, profileName: string, endpointName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, profileName: string, endpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * @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 endpoint Endpoint properties + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, profileName: string, endpointName: string, endpoint: Models.Endpoint, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,profileName,endpointName,endpoint,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified + * subscription, resource group and profile. Only tags and Origin HostHeader can be updated after + * creating an endpoint. To update origins, use the Update Origin operation. To update custom + * domains, use the Update Custom Domain operation. + * @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 endpointUpdateProperties Endpoint update properties + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, profileName: string, endpointName: string, endpointUpdateProperties: Models.EndpointUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,profileName,endpointName,endpointUpdateProperties,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified + * subscription, resource group and profile. + * @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 [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,profileName,endpointName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * @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 [options] The optional parameters + * @returns Promise + */ + start(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginStart(resourceGroupName,profileName,endpointName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Stops an existing running CDN endpoint. + * @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 [options] The optional parameters + * @returns Promise + */ + stop(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginStop(resourceGroupName,profileName,endpointName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Removes a content from CDN. + * @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 contentPaths The path to the content to be purged. Can describe a file path or a wild + * card directory. + * @param [options] The optional parameters + * @returns Promise + */ + purgeContent(resourceGroupName: string, profileName: string, endpointName: string, contentPaths: string[], options?: msRest.RequestOptionsBase): Promise { + return this.beginPurgeContent(resourceGroupName,profileName,endpointName,contentPaths,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * @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 contentPaths The path to the content to be loaded. Path should be a relative file URL of + * the origin. + * @param [options] The optional parameters + * @returns Promise + */ + loadContent(resourceGroupName: string, profileName: string, endpointName: string, contentPaths: string[], options?: msRest.RequestOptionsBase): Promise { + return this.beginLoadContent(resourceGroupName,profileName,endpointName,contentPaths,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * @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 hostName The host name of the custom domain. Must be a domain name. + * @param [options] The optional parameters + * @returns Promise + */ + validateCustomDomain(resourceGroupName: string, profileName: string, endpointName: string, hostName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 hostName The host name of the custom domain. Must be a domain name. + * @param callback The callback + */ + validateCustomDomain(resourceGroupName: string, profileName: string, endpointName: string, hostName: string, callback: msRest.ServiceCallback): void; + /** + * @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 hostName The host name of the custom domain. Must be a domain name. + * @param options The optional parameters + * @param callback The callback + */ + validateCustomDomain(resourceGroupName: string, profileName: string, endpointName: string, hostName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateCustomDomain(resourceGroupName: string, profileName: string, endpointName: string, hostName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + hostName, + options + }, + validateCustomDomainOperationSpec, + callback) as Promise; + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * @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 [options] The optional parameters + * @returns Promise + */ + listResourceUsage(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + listResourceUsage(resourceGroupName: string, profileName: string, endpointName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + listResourceUsage(resourceGroupName: string, profileName: string, endpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listResourceUsage(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + listResourceUsageOperationSpec, + callback) as Promise; + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * @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 endpoint Endpoint properties + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, profileName: string, endpointName: string, endpoint: Models.Endpoint, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + endpoint, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified + * subscription, resource group and profile. Only tags and Origin HostHeader can be updated after + * creating an endpoint. To update origins, use the Update Origin operation. To update custom + * domains, use the Update Custom Domain operation. + * @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 endpointUpdateProperties Endpoint update properties + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, profileName: string, endpointName: string, endpointUpdateProperties: Models.EndpointUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + endpointUpdateProperties, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified + * subscription, resource group and profile. + * @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 [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * @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 [options] The optional parameters + * @returns Promise + */ + beginStart(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + beginStartOperationSpec, + options); + } + + /** + * Stops an existing running CDN endpoint. + * @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 [options] The optional parameters + * @returns Promise + */ + beginStop(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + beginStopOperationSpec, + options); + } + + /** + * Removes a content from CDN. + * @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 contentPaths The path to the content to be purged. Can describe a file path or a wild + * card directory. + * @param [options] The optional parameters + * @returns Promise + */ + beginPurgeContent(resourceGroupName: string, profileName: string, endpointName: string, contentPaths: string[], options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + contentPaths, + options + }, + beginPurgeContentOperationSpec, + options); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * @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 contentPaths The path to the content to be loaded. Path should be a relative file URL of + * the origin. + * @param [options] The optional parameters + * @returns Promise + */ + beginLoadContent(resourceGroupName: string, profileName: string, endpointName: string, contentPaths: string[], options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + contentPaths, + options + }, + beginLoadContentOperationSpec, + options); + } + + /** + * Lists existing CDN endpoints. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByProfileNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByProfileNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByProfileNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByProfileNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByProfileNextOperationSpec, + callback) as Promise; + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listResourceUsageNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listResourceUsageNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listResourceUsageNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listResourceUsageNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listResourceUsageNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByProfileOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EndpointListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Endpoint + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const validateCustomDomainOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + hostName: "hostName" + }, + mapper: { + ...Mappers.ValidateCustomDomainInput, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ValidateCustomDomainOutput + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listResourceUsageOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceUsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "endpoint", + mapper: { + ...Mappers.Endpoint, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Endpoint + }, + 201: { + bodyMapper: Mappers.Endpoint + }, + 202: { + bodyMapper: Mappers.Endpoint + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "endpointUpdateProperties", + mapper: { + ...Mappers.EndpointUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Endpoint + }, + 202: { + bodyMapper: Mappers.Endpoint + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginStartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Endpoint + }, + 202: { + bodyMapper: Mappers.Endpoint + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginStopOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Endpoint + }, + 202: { + bodyMapper: Mappers.Endpoint + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginPurgeContentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + contentPaths: "contentPaths" + }, + mapper: { + ...Mappers.PurgeParameters, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginLoadContentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + contentPaths: "contentPaths" + }, + mapper: { + ...Mappers.LoadParameters, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByProfileNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EndpointListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listResourceUsageNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceUsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/lib/operations/index.ts b/sdk/cdn/arm-cdn/lib/operations/index.ts new file mode 100644 index 000000000000..36365ff3eca2 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./profiles"; +export * from "./endpoints"; +export * from "./origins"; +export * from "./customDomains"; +export * from "./resourceUsageOperations"; +export * from "./operations"; +export * from "./edgeNodes"; diff --git a/sdk/cdn/arm-cdn/lib/operations/operations.ts b/sdk/cdn/arm-cdn/lib/operations/operations.ts new file mode 100644 index 000000000000..09c0ecfd5439 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: CdnManagementClientContext; + + /** + * Create a Operations. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available CDN REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available CDN REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Cdn/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/lib/operations/origins.ts b/sdk/cdn/arm-cdn/lib/operations/origins.ts new file mode 100644 index 000000000000..88d68f8f92ee --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/origins.ts @@ -0,0 +1,285 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/originsMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a Origins. */ +export class Origins { + private readonly client: CdnManagementClientContext; + + /** + * Create a Origins. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the existing origins within an endpoint. + * @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 [options] The optional parameters + * @returns Promise + */ + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEndpoint(resourceGroupName: string, profileName: string, endpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + options + }, + listByEndpointOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing origin within an endpoint. + * @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 originName Name of the origin which is unique within the endpoint. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, profileName: string, endpointName: string, originName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 originName Name of the origin which is unique within the endpoint. + * @param callback The callback + */ + get(resourceGroupName: string, profileName: string, endpointName: string, originName: string, callback: msRest.ServiceCallback): void; + /** + * @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 originName Name of the origin which is unique within the endpoint. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, profileName: string, endpointName: string, originName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, profileName: string, endpointName: string, originName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + endpointName, + originName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates an existing origin within an endpoint. + * @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 originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, profileName: string, endpointName: string, originName: string, originUpdateProperties: Models.OriginUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,profileName,endpointName,originName,originUpdateProperties,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing origin within an endpoint. + * @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 originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, profileName: string, endpointName: string, originName: string, originUpdateProperties: Models.OriginUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + endpointName, + originName, + originUpdateProperties, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Lists all of the existing origins within an endpoint. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByEndpointNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByEndpointNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByEndpointNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByEndpointNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByEndpointNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByEndpointOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OriginListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.originName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Origin + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.endpointName, + Parameters.originName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "originUpdateProperties", + mapper: { + ...Mappers.OriginUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Origin + }, + 202: { + bodyMapper: Mappers.Origin + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByEndpointNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OriginListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/lib/operations/profiles.ts b/sdk/cdn/arm-cdn/lib/operations/profiles.ts new file mode 100644 index 000000000000..cda521b7a1d0 --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/profiles.ts @@ -0,0 +1,712 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/profilesMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a Profiles. */ +export class Profiles { + private readonly client: CdnManagementClientContext; + + /** + * Create a Profiles. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the CDN profiles within a resource group. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets a CDN profile with the specified profile name under the specified subscription and resource + * group. + * @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 [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + get(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource + * group. + * @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 profile Profile properties needed to create a new profile. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, profileName: string, profile: Models.Profile, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,profileName,profile,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription + * and resource group. + * @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 [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, profileName: string, options?: Models.ProfilesUpdateOptionalParams): Promise { + return this.beginUpdate(resourceGroupName,profileName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in + * the deletion of all of the sub-resources including endpoints, origins and custom domains. + * @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 [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,profileName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal + * is used to configure advanced feature capabilities that are not yet available in the Azure + * portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and + * real-time stats and alerts in a premium profile. The SSO URI changes approximately every 10 + * minutes. + * @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 [options] The optional parameters + * @returns Promise + */ + generateSsoUri(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + generateSsoUri(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + generateSsoUri(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + generateSsoUri(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + options + }, + generateSsoUriOperationSpec, + callback) as Promise; + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint + * with an optimization type from the listed values. + * @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 [options] The optional parameters + * @returns Promise + */ + listSupportedOptimizationTypes(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + listSupportedOptimizationTypes(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + listSupportedOptimizationTypes(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSupportedOptimizationTypes(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + options + }, + listSupportedOptimizationTypesOperationSpec, + callback) as Promise; + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * @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 [options] The optional parameters + * @returns Promise + */ + listResourceUsage(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @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 callback The callback + */ + listResourceUsage(resourceGroupName: string, profileName: string, callback: msRest.ServiceCallback): void; + /** + * @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 options The optional parameters + * @param callback The callback + */ + listResourceUsage(resourceGroupName: string, profileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listResourceUsage(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + profileName, + options + }, + listResourceUsageOperationSpec, + callback) as Promise; + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource + * group. + * @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 profile Profile properties needed to create a new profile. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, profileName: string, profile: Models.Profile, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + profile, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription + * and resource group. + * @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 [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, profileName: string, options?: Models.ProfilesBeginUpdateOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in + * the deletion of all of the sub-resources including endpoints, origins and custom domains. + * @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 [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, profileName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + profileName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the CDN profiles within a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listResourceUsageNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listResourceUsageNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listResourceUsageNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listResourceUsageNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listResourceUsageNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProfileListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProfileListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Profile + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const generateSsoUriOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SsoUri + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listSupportedOptimizationTypesOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SupportedOptimizationTypesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listResourceUsageOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceUsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "profile", + mapper: { + ...Mappers.Profile, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Profile + }, + 201: { + bodyMapper: Mappers.Profile + }, + 202: { + bodyMapper: Mappers.Profile + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: [ + "options", + "tags" + ] + }, + mapper: { + ...Mappers.ProfileUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Profile + }, + 202: { + bodyMapper: Mappers.Profile + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.profileName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProfileListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProfileListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listResourceUsageNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceUsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/lib/operations/resourceUsageOperations.ts b/sdk/cdn/arm-cdn/lib/operations/resourceUsageOperations.ts new file mode 100644 index 000000000000..a8af3311c17b --- /dev/null +++ b/sdk/cdn/arm-cdn/lib/operations/resourceUsageOperations.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/resourceUsageOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { CdnManagementClientContext } from "../cdnManagementClientContext"; + +/** Class representing a ResourceUsageOperations. */ +export class ResourceUsageOperations { + private readonly client: CdnManagementClientContext; + + /** + * Create a ResourceUsageOperations. + * @param {CdnManagementClientContext} client Reference to the service client. + */ + constructor(client: CdnManagementClientContext) { + this.client = client; + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceUsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceUsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/cdn/arm-cdn/package.json b/sdk/cdn/arm-cdn/package.json index c5945226f8ba..c65946aa632e 100644 --- a/sdk/cdn/arm-cdn/package.json +++ b/sdk/cdn/arm-cdn/package.json @@ -4,8 +4,8 @@ "description": "CdnManagementClient Library with typescript type definitions for node.js and browser.", "version": "4.2.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.6.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/cdn/arm-cdn", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-cdn.js.map'\" -o ./dist/arm-cdn.min.js ./dist/arm-cdn.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "autoPublish": true + "sideEffects": false } diff --git a/sdk/cdn/arm-cdn/tsconfig.json b/sdk/cdn/arm-cdn/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/cdn/arm-cdn/tsconfig.json +++ b/sdk/cdn/arm-cdn/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }