withPremiumOrigin(String originHostName);
+ }
+ }
+
+ /** The final stage of the CDN profile Standard Akamai or Standard Verizon endpoint definition.
+ *
+ * At this stage, any remaining optional settings can be specified, or the CDN profile endpoint
+ * definition can be attached to the parent CDN profile definition using {@link CdnEndpoint.DefinitionStages.AttachableStandard#attach()}.
+ * @param the return type of {@link CdnEndpoint.DefinitionStages.AttachableStandard#attach()}
+ */
+ interface WithStandardAttach
+ extends AttachableStandard {
+ /**
+ * Specifies origin path.
+ *
+ * @param originPath origin path.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withOriginPath(String originPath);
+
+ /**
+ * Specifies host header.
+ *
+ * @param hostHeader host header.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHostHeader(String hostHeader);
+
+ /**
+ * Specifies if http traffic is allowed.
+ *
+ * @param httpAllowed if set to true Http traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpAllowed(boolean httpAllowed);
+
+ /**
+ * Specifies if https traffic is allowed.
+ *
+ * @param httpsAllowed if set to true Https traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpsAllowed(boolean httpsAllowed);
+
+ /**
+ * Specifies http port for http traffic.
+ *
+ * @param httpPort http port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpPort(int httpPort);
+
+ /**
+ * Specifies https port for http traffic.
+ *
+ * @param httpsPort https port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpsPort(int httpsPort);
+
+ /**
+ * Specifies the content types to compress.
+ *
+ * @param contentTypesToCompress the list of content types to compress to set
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withContentTypesToCompress(List contentTypesToCompress);
+
+ /**
+ * Specifies a single content type to compress.
+ *
+ * @param contentTypeToCompress a singe content type to compress to add to the list
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withContentTypeToCompress(String contentTypeToCompress);
+
+ /**
+ * Sets the compression state.
+ *
+ * @param compressionEnabled if set to true compression will be enabled. If set to false compression will be disabled
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withCompressionEnabled(boolean compressionEnabled);
+
+ /**
+ * Sets the query string caching behavior.
+ *
+ * @param cachingBehavior the query string caching behavior value to set
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withQueryStringCachingBehavior(QueryStringCachingBehavior cachingBehavior);
+
+ /**
+ * Sets the geo filters list.
+ *
+ * @param geoFilters the Geo filters list to set
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withGeoFilters(List geoFilters);
+
+ /**
+ * Adds a single entry to the Geo filters list.
+ *
+ * @param relativePath the relative path.
+ * @param action the action value.
+ * @param countryCode the ISO 2 letter country codes.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withGeoFilter(String relativePath, GeoFilterActions action, CountryISOCode countryCode);
+
+ /**
+ * Sets the geo filters list for the specified countries list.
+ *
+ * @param relativePath the relative path.
+ * @param action the action value.
+ * @param countryCodes a list of the ISO 2 letter country codes.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withGeoFilter(String relativePath, GeoFilterActions action, List countryCodes);
+
+ /**
+ * Adds a new CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withCustomDomain(String hostName);
+ }
+
+ /** The final stage of the CDN profile Premium Verizon endpoint definition.
+ *
+ * At this stage, any remaining optional settings can be specified, or the CDN profile endpoint
+ * definition can be attached to the parent CDN profile definition using {@link CdnEndpoint.DefinitionStages.AttachablePremium#attach()}.
+ * @param the return type of {@link CdnEndpoint.DefinitionStages.AttachablePremium#attach()}
+ */
+ interface WithPremiumAttach
+ extends AttachablePremium {
+ /**
+ * Specifies origin path.
+ *
+ * @param originPath origin path.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withOriginPath(String originPath);
+
+ /**
+ * Specifies host header.
+ *
+ * @param hostHeader host header.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHostHeader(String hostHeader);
+
+ /**
+ * Specifies if http traffic is allowed.
+ *
+ * @param httpAllowed if set to true Http traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpAllowed(boolean httpAllowed);
+
+ /**
+ * Specifies if https traffic is allowed.
+ *
+ * @param httpsAllowed if set to true Https traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpsAllowed(boolean httpsAllowed);
+
+ /**
+ * Specifies http port for http traffic.
+ *
+ * @param httpPort http port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpPort(int httpPort);
+
+ /**
+ * Specifies https port for http traffic.
+ *
+ * @param httpsPort https port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpsPort(int httpsPort);
+
+ /**
+ * Adds a new CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withCustomDomain(String hostName);
+ }
+
+ /**
+ * The final stage of the Standard endpoint object definition, at which it can be attached to the parent, using {@link AttachableStandard#attach()}.
+ *
+ * @param the parent definition {@link AttachableStandard#attach()} returns to
+ */
+ interface AttachableStandard {
+ ParentT attach();
+ }
+
+ /**
+ * The final stage of the Premium Verizon endpoint object definition, at which it can be attached to the parent, using {@link AttachableStandard#attach()}.
+ *
+ * @param the parent definition {@link AttachableStandard#attach()} returns to
+ */
+ interface AttachablePremium {
+ ParentT attach();
+ }
+ }
+
+ /**
+ * The entirety of a CDN profile endpoint definition as a part of parent update.
+ */
+ interface UpdateDefinitionStages {
+ /**
+ * The first stage of a CDN profile endpoint definition.
+ */
+ interface Blank {
+ /**
+ * The stage of the CDN profile endpoint definition allowing to specify the origin.
+ *
+ * @param the return type of {@link AttachableStandard#attach()}
+ */
+ interface StandardEndpoint {
+ /**
+ * Specifies the origin of the CDN endpoint.
+ *
+ * @param originName name of the origin.
+ * @param originHostName origin host name.
+ * @return the next stage of the definition
+ */
+ UpdateDefinitionStages.WithStandardAttach withOrigin(String originName, String originHostName);
+
+ /**
+ * Specifies the origin of the CDN endpoint.
+ *
+ * @param originHostName origin host name.
+ * @return the next stage of the definition
+ */
+ UpdateDefinitionStages.WithStandardAttach withOrigin(String originHostName);
+ }
+
+ /**
+ * The stage of the CDN profile endpoint definition allowing to specify the origin
+ * for CDN Profile with Premium Verizon sku.
+ *
+ * @param the return type of {@link AttachablePremium#attach()}
+ */
+ interface PremiumEndpoint {
+ /**
+ * Specifies the origin of the CDN endpoint.
+ *
+ * @param originName name of the origin.
+ * @param originHostName origin host name.
+ * @return the next stage of the definition
+ */
+ UpdateDefinitionStages.WithPremiumAttach withPremiumOrigin(String originName, String originHostName);
+
+ /**
+ * Specifies the origin of the CDN endpoint.
+ *
+ * @param originHostName origin host name.
+ * @return the next stage of the definition
+ */
+ UpdateDefinitionStages.WithPremiumAttach withPremiumOrigin(String originHostName);
+ }
+ }
+
+ /** The final stage of the CDN profile Standard Akamai or Standard Verizon endpoint definition.
+ *
+ * At this stage, any remaining optional settings can be specified, or the CDN profile endpoint
+ * definition can be attached to the parent CDN profile definition using {@link CdnEndpoint.DefinitionStages.AttachableStandard#attach()}.
+ * @param the return type of {@link CdnEndpoint.DefinitionStages.AttachableStandard#attach()}
+ */
+ interface WithStandardAttach
+ extends AttachableStandard {
+ /**
+ * Specifies origin path.
+ *
+ * @param originPath origin path.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withOriginPath(String originPath);
+
+ /**
+ * Specifies host header.
+ *
+ * @param hostHeader host header.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHostHeader(String hostHeader);
+
+ /**
+ * Specifies if http traffic is allowed.
+ *
+ * @param httpAllowed if set to true Http traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpAllowed(boolean httpAllowed);
+
+ /**
+ * Specifies if https traffic is allowed.
+ *
+ * @param httpsAllowed if set to true Https traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpsAllowed(boolean httpsAllowed);
+
+ /**
+ * Specifies http port for http traffic.
+ *
+ * @param httpPort http port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpPort(int httpPort);
+
+ /**
+ * Specifies https port for http traffic.
+ *
+ * @param httpsPort https port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withHttpsPort(int httpsPort);
+
+ /**
+ * Specifies the content types to compress.
+ *
+ * @param contentTypesToCompress the list of content types to compress to set
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withContentTypesToCompress(List contentTypesToCompress);
+
+ /**
+ * Specifies a single content type to compress.
+ *
+ * @param contentTypeToCompress a singe content type to compress to add to the list
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withContentTypeToCompress(String contentTypeToCompress);
+
+ /**
+ * Sets the compression state.
+ *
+ * @param compressionEnabled if set to true compression will be enabled. If set to false compression will be disabled
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withCompressionEnabled(boolean compressionEnabled);
+
+ /**
+ * Sets the query string caching behavior.
+ *
+ * @param cachingBehavior the query string caching behavior value to set
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withQueryStringCachingBehavior(QueryStringCachingBehavior cachingBehavior);
+
+ /**
+ * Sets the geo filters list.
+ *
+ * @param geoFilters the Geo filters list to set
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withGeoFilters(List geoFilters);
+
+ /**
+ * Adds a single entry to the Geo filters list.
+ *
+ * @param relativePath the relative path.
+ * @param action the action value.
+ * @param countryCode the ISO 2 letter country codes.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withGeoFilter(String relativePath, GeoFilterActions action, CountryISOCode countryCode);
+
+ /**
+ * Sets the geo filters list for the specified countries list.
+ *
+ * @param relativePath the relative path.
+ * @param action the action value.
+ * @param countryCodes a list of the ISO 2 letter country codes.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withGeoFilter(String relativePath, GeoFilterActions action, List countryCodes);
+
+ /**
+ * Adds a new CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint definition
+ */
+ WithStandardAttach withCustomDomain(String hostName);
+ }
+
+ /** The final stage of the CDN profile Premium Verizon endpoint definition.
+ *
+ * At this stage, any remaining optional settings can be specified, or the CDN profile endpoint
+ * definition can be attached to the parent CDN profile definition using {@link CdnEndpoint.DefinitionStages.AttachablePremium#attach()}.
+ * @param the return type of {@link CdnEndpoint.DefinitionStages.AttachablePremium#attach()}
+ */
+ interface WithPremiumAttach
+ extends AttachablePremium {
+ /**
+ * Specifies origin path.
+ *
+ * @param originPath origin path.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withOriginPath(String originPath);
+
+ /**
+ * Specifies host header.
+ *
+ * @param hostHeader host header.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHostHeader(String hostHeader);
+
+ /**
+ * Specifies if http traffic is allowed.
+ *
+ * @param httpAllowed if set to true Http traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpAllowed(boolean httpAllowed);
+
+ /**
+ * Specifies if https traffic is allowed.
+ *
+ * @param httpsAllowed if set to true Https traffic will be allowed.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpsAllowed(boolean httpsAllowed);
+
+ /**
+ * Specifies http port for http traffic.
+ *
+ * @param httpPort http port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpPort(int httpPort);
+
+ /**
+ * Specifies https port for http traffic.
+ *
+ * @param httpsPort https port number.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withHttpsPort(int httpsPort);
+
+ /**
+ * Adds a new CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint definition
+ */
+ WithPremiumAttach withCustomDomain(String hostName);
+ }
+
+ /**
+ * The final stage of the Standard endpoint object definition, at which it can be attached to the parent, using {@link AttachableStandard#attach()}.
+ *
+ * @param the parent definition {@link AttachableStandard#attach()} returns to
+ */
+ interface AttachableStandard {
+ ParentT attach();
+ }
+
+ /**
+ * The final stage of the Premium Verizon endpoint object definition, at which it can be attached to the parent, using {@link AttachableStandard#attach()}.
+ *
+ * @param the parent definition {@link AttachableStandard#attach()} returns to
+ */
+ interface AttachablePremium {
+ ParentT attach();
+ }
+ }
+
+ /**
+ * The stage of an CDN profile endpoint update allowing to specify endpoint properties.
+ */
+ interface UpdateStandardEndpoint extends Update {
+ /**
+ * Specifies origin path.
+ *
+ * @param originPath origin path.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withOriginPath(String originPath);
+
+ /**
+ * Specifies host header.
+ *
+ * @param hostHeader host header.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withHostHeader(String hostHeader);
+ /**
+ * Specifies if http traffic is allowed.
+ *
+ * @param httpAllowed if set to true Http traffic will be allowed.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withHttpAllowed(boolean httpAllowed);
+
+ /**
+ * Specifies if https traffic is allowed.
+ *
+ * @param httpsAllowed if set to true Https traffic will be allowed.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withHttpsAllowed(boolean httpsAllowed);
+
+ /**
+ * Specifies http port for http traffic.
+ *
+ * @param httpPort http port number.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withHttpPort(int httpPort);
+
+ /**
+ * Specifies https port for http traffic.
+ *
+ * @param httpsPort https port number.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withHttpsPort(int httpsPort);
+
+ /**
+ * Specifies the content types to compress.
+ *
+ * @param contentTypesToCompress the list of content types to compress to set
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withContentTypesToCompress(List contentTypesToCompress);
+
+ /**
+ * Clears entire list of content types to compress .
+ *
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withoutContentTypesToCompress();
+
+ /**
+ * Specifies a single content type to compress.
+ *
+ * @param contentTypeToCompress a singe content type to compress to add to the list
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withContentTypeToCompress(String contentTypeToCompress);
+
+ /**
+ * Removes the content type to compress value from the list.
+ *
+ * @param contentTypeToCompress a singe content type to remove from the list
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withoutContentTypeToCompress(String contentTypeToCompress);
+
+ /**
+ * Sets the compression state.
+ *
+ * @param compressionEnabled if set to true compression will be enabled. If set to false compression will be disabled
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withCompressionEnabled(boolean compressionEnabled);
+
+ /**
+ * Sets the query string caching behavior.
+ *
+ * @param cachingBehavior the query string caching behavior value to set
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withQueryStringCachingBehavior(QueryStringCachingBehavior cachingBehavior);
+
+ /**
+ * Sets the geo filters list.
+ *
+ * @param geoFilters the Geo filters list to set
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withGeoFilters(List geoFilters);
+
+ /**
+ * Clears entire geo filters list.
+ *
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withoutGeoFilters();
+
+ /**
+ * Adds a single entry to the Geo filters list.
+ *
+ * @param relativePath the relative path.
+ * @param action the action value.
+ * @param countryCode the ISO 2 letter country codes.
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withGeoFilter(String relativePath, GeoFilterActions action, CountryISOCode countryCode);
+
+ /**
+ * Sets the geo filters list for the specified countries list.
+ *
+ * @param relativePath the relative path.
+ * @param action the action value.
+ * @param countryCodes a list of the ISO 2 letter country codes.
+ * @return the next stage of the endpoint definition
+ */
+ UpdateStandardEndpoint withGeoFilter(String relativePath, GeoFilterActions action, List countryCodes);
+
+ /**
+ * Removes an entry from the geo filters list.
+ *
+ * @param relativePath the relative path value.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withoutGeoFilter(String relativePath);
+
+ /**
+ * Adds a new CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withCustomDomain(String hostName);
+
+ /**
+ * Removes CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint update
+ */
+ UpdateStandardEndpoint withoutCustomDomain(String hostName);
+ }
+
+ /**
+ * The stage of an CDN profile endpoint update allowing to specify endpoint properties.
+ */
+ interface UpdatePremiumEndpoint extends Update {
+ /**
+ * Specifies origin path.
+ *
+ * @param originPath origin path.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withOriginPath(String originPath);
+
+ /**
+ * Specifies host header.
+ *
+ * @param hostHeader host header.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withHostHeader(String hostHeader);
+
+ /**
+ * Specifies if http traffic is allowed.
+ *
+ * @param httpAllowed if set to true Http traffic will be allowed.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withHttpAllowed(boolean httpAllowed);
+
+ /**
+ * Specifies if https traffic is allowed.
+ *
+ * @param httpsAllowed if set to true Https traffic will be allowed.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withHttpsAllowed(boolean httpsAllowed);
+
+ /**
+ * Specifies http port for http traffic.
+ *
+ * @param httpPort http port number.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withHttpPort(int httpPort);
+
+ /**
+ * Specifies https port for http traffic.
+ *
+ * @param httpsPort https port number.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withHttpsPort(int httpsPort);
+
+ /**
+ * Adds a new CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withCustomDomain(String hostName);
+
+ /**
+ * Removes CDN custom domain within an endpoint.
+ *
+ * @param hostName custom domain host name.
+ * @return the next stage of the endpoint update
+ */
+ UpdatePremiumEndpoint withoutCustomDomain(String hostName);
+ }
+
+ /**
+ * The set of configurations that can be updated for all endpoint irrespective of their type.
+ */
+ interface Update extends
+ Settable {
+ }
+}
\ No newline at end of file
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnProfile.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnProfile.java
new file mode 100644
index 000000000000..455fa372aeb5
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnProfile.java
@@ -0,0 +1,362 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.microsoft.azure.management.apigeneration.Fluent;
+import com.microsoft.azure.management.cdn.implementation.ProfileInner;
+import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource;
+import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource;
+import com.microsoft.azure.management.resources.fluentcore.model.Appliable;
+import com.microsoft.azure.management.resources.fluentcore.model.Creatable;
+import com.microsoft.azure.management.resources.fluentcore.model.Refreshable;
+import com.microsoft.azure.management.resources.fluentcore.model.Updatable;
+import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * An immutable client-side representation of an Azure CDN profile.
+ */
+@Fluent
+public interface CdnProfile extends
+ GroupableResource,
+ Refreshable,
+ Wrapper,
+ Updatable {
+
+ /**
+ * @return Sku.
+ */
+ Sku sku();
+
+ /**
+ * @return CDN profile state.
+ */
+ String resourceState();
+
+ /**
+ * @return endpoints in the CDN manager profile, indexed by the name
+ */
+ Map endpoints();
+
+ /**
+ * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal used for advanced management tasks.
+ *
+ * @return URI used to login to third party web portal.
+ */
+ String generateSsoUri();
+
+ /**
+ * Starts stopped CDN endpoint in current profile.
+ *
+ * @param endpointName name of the endpoint under the profile which is unique globally.
+ */
+ void startEndpoint(String endpointName);
+
+ /**
+ * Stops running CDN endpoint in the current profile.
+ *
+ * @param endpointName name of the endpoint under the profile which is unique globally.
+ */
+ void stopEndpoint(String endpointName);
+
+ /**
+ * Forcibly purges CDN endpoint content in current profile.
+ *
+ * @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.
+ */
+ void purgeEndpointContent(String endpointName, List contentPaths);
+
+ /**
+ * Forcibly pre-loads CDN endpoint content in current profile. Available for Verizon Profiles.
+ *
+ * @param endpointName name of the endpoint under the profile which is unique globally.
+ * @param contentPaths the path to the content to be loaded. Should describe a file path.
+ */
+ void loadEndpointContent(String endpointName, List contentPaths);
+
+ /**
+ * Validates a custom domain mapping to ensure it maps to the correct CNAME in DNS in current profile.
+ *
+ * @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.
+ * @return CustomDomainValidationResult object if successful.
+ */
+ CustomDomainValidationResult validateEndpointCustomDomain(String endpointName, String hostName);
+
+ /**
+ * Checks the availability of a endpoint name without creating the CDN endpoint.
+ *
+ * @param name the endpoint resource name to validate.
+ * @return the CheckNameAvailabilityResult object if successful.
+ */
+ CheckNameAvailabilityResult checkEndpointNameAvailability(String name);
+
+ /**
+ * Checks if current instance of CDN profile Sku is Premium Verizon.
+ *
+ * @return true if current instance of CDN Profile Sku is of Premium Verizon, false otherwise.
+ */
+ boolean isPremiumVerizon();
+
+ /**************************************************************
+ * Fluent interfaces to provision a CDN.
+ **************************************************************/
+ /**
+ * The entirety of the CDN profile.
+ */
+ interface Definition extends
+ DefinitionStages.Blank,
+ DefinitionStages.WithGroup,
+ DefinitionStages.WithSku,
+ DefinitionStages.WithStandardCreate,
+ DefinitionStages.WithPremiumVerizonCreate,
+ DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of CDN profile definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a CDN profile definition.
+ */
+ interface Blank extends DefinitionWithRegion {
+ }
+
+ /**
+ * A Redis Cache definition allowing resource group to be set.
+ */
+ interface WithGroup extends GroupableResource.DefinitionStages.WithGroup {
+ }
+
+ /**
+ * A CDN profile definition allowing the sku to be set.
+ */
+ interface WithSku {
+ /**
+ * Specifies the Standard Akamai sku of the CDN profile.
+ *
+ * @return the next stage of CDN profile definition.
+ */
+ WithStandardCreate withStandardAkamaiSku();
+
+ /**
+ * Specifies the Standard Verizon sku of the CDN profile.
+ *
+ * @return the next stage of CDN profile definition.
+ */
+ WithStandardCreate withStandardVerizonSku();
+
+ /**
+ * Specifies the Premium Verizon sku of the CDN profile.
+ *
+ * @return the next stage of CDN profile definition.
+ */
+ WithPremiumVerizonCreate withPremiumVerizonSku();
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for the resource to be created
+ * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified.
+ */
+ interface WithStandardCreate extends WithCreate {
+ /**
+ * Adds new endpoint to current CDN profile.
+ *
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the next stage of CDN profile definition.
+ */
+ WithStandardCreate withNewEndpoint(String endpointOriginHostname);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.DefinitionStages.Blank.StandardEndpoint defineNewEndpoint();
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.DefinitionStages.Blank.StandardEndpoint defineNewEndpoint(String name);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.DefinitionStages.WithStandardAttach defineNewEndpoint(String name, String endpointOriginHostname);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for the resource to be created
+ * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified.
+ */
+ interface WithPremiumVerizonCreate extends WithCreate {
+ /**
+ * Adds new endpoint to current CDN profile.
+ *
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the next stage of CDN profile definition.
+ */
+ WithPremiumVerizonCreate withNewPremiumEndpoint(String endpointOriginHostname);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.DefinitionStages.Blank.PremiumEndpoint defineNewPremiumEndpoint();
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.DefinitionStages.Blank.PremiumEndpoint defineNewPremiumEndpoint(String name);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.DefinitionStages.WithPremiumAttach defineNewPremiumEndpoint(String name, String endpointOriginHostname);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for the resource to be created
+ * (via {@link WithCreate#create()}), but also allows for any other optional settings to be specified.
+ */
+ interface WithCreate extends
+ Creatable,
+ Resource.DefinitionWithTags {
+ }
+ }
+
+ /**
+ * Grouping of CDN manager update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the CDN profile update allowing to specify the endpoints
+ * for the profile.
+ */
+ interface WithEndpoint {
+ /**
+ * Adds new endpoint to current CDN profile.
+ *
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the next stage of CDN profile update.
+ */
+ Update withNewEndpoint(String endpointOriginHostname);
+
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.UpdateDefinitionStages.Blank.StandardEndpoint defineNewEndpoint();
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.UpdateDefinitionStages.Blank.StandardEndpoint defineNewEndpoint(String name);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.UpdateDefinitionStages.WithStandardAttach defineNewEndpoint(String name, String endpointOriginHostname);
+
+ /**
+ * Adds new endpoint to current Premium Verizon CDN profile.
+ *
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the next stage of CDN profile update.
+ */
+ Update withNewPremiumEndpoint(String endpointOriginHostname);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the current Premium Verizon CDN profile.
+ *
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.UpdateDefinitionStages.Blank.PremiumEndpoint defineNewPremiumEndpoint();
+
+ /**
+ * Specifies definition of an endpoint to be attached to the current Premium Verizon CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.UpdateDefinitionStages.Blank.PremiumEndpoint defineNewPremiumEndpoint(String name);
+
+ /**
+ * Specifies definition of an endpoint to be attached to the current Premium Verizon CDN profile.
+ *
+ * @param name the name for the endpoint
+ * @param endpointOriginHostname the endpoint origin hostname.
+ * @return the stage representing configuration for the endpoint
+ */
+ CdnEndpoint.UpdateDefinitionStages.WithPremiumAttach defineNewPremiumEndpoint(String name, String endpointOriginHostname);
+
+ /**
+ * Begins the description of an update of an existing endpoint in current profile.
+ *
+ * @param name the name of the endpoint
+ * @return the stage representing updating configuration for the endpoint
+ */
+ CdnEndpoint.UpdateStandardEndpoint updateEndpoint(String name);
+
+ /**
+ * Begins the description of an update of an existing endpoint in current Premium Verizon profile.
+ *
+ * @param name the name of the endpoint
+ * @return the stage representing updating configuration for the endpoint
+ */
+ CdnEndpoint.UpdatePremiumEndpoint updatePremiumEndpoint(String name);
+
+ /**
+ * Removes an endpoint in the profile.
+ *
+ * @param name the name of the endpoint
+ * @return the next stage of the CDN profile update
+ */
+ Update withoutEndpoint(String name);
+ }
+ }
+
+ /**
+ * The template for an update operation, containing all the settings that
+ * can be modified.
+ *
+ * Call {@link Update#apply()} to apply the changes to the resource in Azure.
+ */
+ interface Update extends
+ Appliable,
+ UpdateStages.WithEndpoint,
+ Resource.UpdateWithTags {
+ }
+}
\ No newline at end of file
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnProfiles.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnProfiles.java
new file mode 100644
index 000000000000..028b76a46eba
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnProfiles.java
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.microsoft.azure.PagedList;
+import com.microsoft.azure.management.apigeneration.Fluent;
+import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByGroup;
+import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByGroup;
+import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
+import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup;
+import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation;
+import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
+import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById;
+import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;
+
+import java.util.List;
+
+/**
+ * Entry point for CDN profile management API.
+ */
+@Fluent
+public interface CdnProfiles extends
+ SupportsCreating,
+ SupportsListing,
+ SupportsListingByGroup,
+ SupportsGettingByGroup,
+ SupportsGettingById,
+ SupportsDeletingById,
+ SupportsDeletingByGroup,
+ SupportsBatchCreation {
+
+ /**
+ * 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.
+ * @return the Sso Uri string if successful.
+ */
+ String generateSsoUri(String resourceGroupName, String profileName);
+
+ /**
+ * Checks the availability of a endpoint name without creating the CDN endpoint.
+ *
+ * @param name The endpoint resource name to validate.
+ * @return the CheckNameAvailabilityResult object if successful.
+ */
+ CheckNameAvailabilityResult checkEndpointNameAvailability(String name);
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @return list of available CDN REST operations.
+ */
+ PagedList listOperations();
+
+ /**
+ * Starts an existing stopped 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.
+ */
+ void startEndpoint(String resourceGroupName, String profileName, String endpointName);
+
+ /**
+ * 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.
+ */
+ void stopEndpoint(String resourceGroupName, String profileName, String endpointName);
+
+ /**
+ * Forcibly purges CDN endpoint content.
+ *
+ * @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.
+ */
+ void purgeEndpointContent(String resourceGroupName, String profileName, String endpointName, List contentPaths);
+
+ /**
+ * Forcibly pre-loads CDN endpoint content. 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. Should describe a file path.
+ */
+ void loadEndpointContent(String resourceGroupName, String profileName, String endpointName, List contentPaths);
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityInput.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityInput.java
new file mode 100644
index 000000000000..57f522562fb6
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityInput.java
@@ -0,0 +1,76 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Input of CheckNameAvailability API.
+ */
+public class CheckNameAvailabilityInput {
+ /**
+ * The resource name to validate.
+ */
+ @JsonProperty(required = true)
+ private String name;
+
+ /**
+ * The type of the resource whose name is to be validated.
+ */
+ @JsonProperty(required = true)
+ private String type;
+
+ /**
+ * Creates an instance of CheckNameAvailabilityInput class.
+ */
+ public CheckNameAvailabilityInput() {
+ type = "Microsoft.Cdn/Profiles/Endpoints";
+ }
+
+ /**
+ * Get the name value.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name value.
+ *
+ * @param name the name value to set
+ * @return the CheckNameAvailabilityInput object itself.
+ */
+ public CheckNameAvailabilityInput withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the type value.
+ *
+ * @return the type value
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type value.
+ *
+ * @param type the type value to set
+ * @return the CheckNameAvailabilityInput object itself.
+ */
+ public CheckNameAvailabilityInput withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityResult.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityResult.java
new file mode 100644
index 000000000000..f0a3211ffce2
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityResult.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.microsoft.azure.management.apigeneration.LangDefinition;
+import com.microsoft.azure.management.cdn.implementation.CheckNameAvailabilityOutputInner;
+
+/**
+ * Result of the custom domain validation.
+ */
+@LangDefinition
+public class CheckNameAvailabilityResult {
+ private CheckNameAvailabilityOutputInner inner;
+
+ /**
+ * Construct CheckNameAvailabilityResult object from server response object.
+ *
+ * @param inner server response for CheckNameAvailability request.
+ */
+ public CheckNameAvailabilityResult(CheckNameAvailabilityOutputInner inner) {
+ this.inner = inner;
+ }
+
+ /**
+ * Indicates whether the name is available.
+ *
+ * @return the nameAvailable value
+ */
+ public boolean nameAvailable() {
+ return this.inner.nameAvailable();
+ }
+
+ /**
+ * Get the reason value.
+ *
+ * @return the reason value
+ */
+ public String reason() {
+ return this.inner.reason();
+ }
+
+ /**
+ * Get the message value.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.inner.message();
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainParameters.java
new file mode 100644
index 000000000000..76c4ad6691b4
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainParameters.java
@@ -0,0 +1,45 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+
+/**
+ * The customDomain JSON object required for custom domain creation or update.
+ */
+@JsonFlatten
+public class CustomDomainParameters {
+ /**
+ * The host name of the custom domain. Must be a domain name.
+ */
+ @JsonProperty(value = "properties.hostName", required = true)
+ private String hostName;
+
+ /**
+ * Get the hostName value.
+ *
+ * @return the hostName value
+ */
+ public String hostName() {
+ return this.hostName;
+ }
+
+ /**
+ * Set the hostName value.
+ *
+ * @param hostName the hostName value to set
+ * @return the CustomDomainParameters object itself.
+ */
+ public CustomDomainParameters withHostName(String hostName) {
+ this.hostName = hostName;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainResourceState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainResourceState.java
new file mode 100644
index 000000000000..9049d8c75cae
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainResourceState.java
@@ -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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for CustomDomainResourceState.
+ */
+public final class CustomDomainResourceState {
+ /** Static value Creating for CustomDomainResourceState. */
+ public static final CustomDomainResourceState CREATING = new CustomDomainResourceState("Creating");
+
+ /** Static value Active for CustomDomainResourceState. */
+ public static final CustomDomainResourceState ACTIVE = new CustomDomainResourceState("Active");
+
+ /** Static value Deleting for CustomDomainResourceState. */
+ public static final CustomDomainResourceState DELETING = new CustomDomainResourceState("Deleting");
+
+ private String value;
+
+ /**
+ * Creates a custom value for CustomDomainResourceState.
+ * @param value the custom value
+ */
+ public CustomDomainResourceState(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof CustomDomainResourceState)) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ CustomDomainResourceState rhs = (CustomDomainResourceState) obj;
+ if (value == null) {
+ return rhs.value == null;
+ } else {
+ return value.equals(rhs.value);
+ }
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainValidationResult.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainValidationResult.java
new file mode 100644
index 000000000000..1cf83b2abc03
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainValidationResult.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+
+import com.microsoft.azure.management.apigeneration.LangDefinition;
+import com.microsoft.azure.management.cdn.implementation.ValidateCustomDomainOutputInner;
+
+/**
+ * The {@link com.microsoft.azure.management.cdn.CdnProfile#validateEndpointCustomDomain(String, String)} action result.
+ */
+@LangDefinition
+public class CustomDomainValidationResult {
+ private ValidateCustomDomainOutputInner inner;
+
+ /**
+ * Construct CustomDomainValidationResult object from server response object.
+ *
+ * @param inner server response for CustomDomainValidation request.
+ */
+ public CustomDomainValidationResult(ValidateCustomDomainOutputInner inner) {
+ this.inner = inner;
+ }
+
+ /**
+ * Get the customDomainValidated value.
+ *
+ * @return the customDomainValidated value
+ */
+ public boolean customDomainValidated() {
+ return this.inner.customDomainValidated();
+ }
+
+ /**
+ * Get the reason value.
+ *
+ * @return the reason value
+ */
+ public String reason() {
+ return this.inner.reason();
+ }
+
+ /**
+ * Get the message value.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.inner.message();
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeepCreatedOrigin.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeepCreatedOrigin.java
new file mode 100644
index 000000000000..5a0adb4fe872
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeepCreatedOrigin.java
@@ -0,0 +1,124 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+
+/**
+ * Origins to be added when creating a CDN endpoint.
+ */
+@JsonFlatten
+public class DeepCreatedOrigin {
+ /**
+ * Origin name.
+ */
+ @JsonProperty(required = true)
+ private String name;
+
+ /**
+ * The address of the origin. Domain names, IPv4 addresses, and IPv6
+ * addresses are supported.
+ */
+ @JsonProperty(value = "properties.hostName", required = true)
+ private String hostName;
+
+ /**
+ * The value of the HTTP port. Must be between 1 and 65535.
+ */
+ @JsonProperty(value = "properties.httpPort")
+ private Integer httpPort;
+
+ /**
+ * The value of the HTTPS port. Must be between 1 and 65535.
+ */
+ @JsonProperty(value = "properties.httpsPort")
+ private Integer httpsPort;
+
+ /**
+ * Get the name value.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name value.
+ *
+ * @param name the name value to set
+ * @return the DeepCreatedOrigin object itself.
+ */
+ public DeepCreatedOrigin withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the hostName value.
+ *
+ * @return the hostName value
+ */
+ public String hostName() {
+ return this.hostName;
+ }
+
+ /**
+ * Set the hostName value.
+ *
+ * @param hostName the hostName value to set
+ * @return the DeepCreatedOrigin object itself.
+ */
+ public DeepCreatedOrigin withHostName(String hostName) {
+ this.hostName = hostName;
+ return this;
+ }
+
+ /**
+ * Get the httpPort value.
+ *
+ * @return the httpPort value
+ */
+ public Integer httpPort() {
+ return this.httpPort;
+ }
+
+ /**
+ * Set the httpPort value.
+ *
+ * @param httpPort the httpPort value to set
+ * @return the DeepCreatedOrigin object itself.
+ */
+ public DeepCreatedOrigin withHttpPort(Integer httpPort) {
+ this.httpPort = httpPort;
+ return this;
+ }
+
+ /**
+ * Get the httpsPort value.
+ *
+ * @return the httpsPort value
+ */
+ public Integer httpsPort() {
+ return this.httpsPort;
+ }
+
+ /**
+ * Set the httpsPort value.
+ *
+ * @param httpsPort the httpsPort value to set
+ * @return the DeepCreatedOrigin object itself.
+ */
+ public DeepCreatedOrigin withHttpsPort(Integer httpsPort) {
+ this.httpsPort = httpsPort;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointResourceState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointResourceState.java
new file mode 100644
index 000000000000..ba1e65615192
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointResourceState.java
@@ -0,0 +1,71 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for EndpointResourceState.
+ */
+public final class EndpointResourceState {
+ /** Static value Creating for EndpointResourceState. */
+ public static final EndpointResourceState CREATING = new EndpointResourceState("Creating");
+
+ /** Static value Deleting for EndpointResourceState. */
+ public static final EndpointResourceState DELETING = new EndpointResourceState("Deleting");
+
+ /** Static value Running for EndpointResourceState. */
+ public static final EndpointResourceState RUNNING = new EndpointResourceState("Running");
+
+ /** Static value Starting for EndpointResourceState. */
+ public static final EndpointResourceState STARTING = new EndpointResourceState("Starting");
+
+ /** Static value Stopped for EndpointResourceState. */
+ public static final EndpointResourceState STOPPED = new EndpointResourceState("Stopped");
+
+ /** Static value Stopping for EndpointResourceState. */
+ public static final EndpointResourceState STOPPING = new EndpointResourceState("Stopping");
+
+ private String value;
+
+ /**
+ * Creates a custom value for EndpointResourceState.
+ * @param value the custom value
+ */
+ public EndpointResourceState(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof EndpointResourceState)) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ EndpointResourceState rhs = (EndpointResourceState) obj;
+ if (value == null) {
+ return rhs.value == null;
+ } else {
+ return value.equals(rhs.value);
+ }
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponse.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponse.java
new file mode 100644
index 000000000000..6ce3ad2d2fa3
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponse.java
@@ -0,0 +1,67 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+
+/**
+ * Error reponse indicates CDN service is not able to process the incoming
+ * request. The reason is provided in the error message.
+ */
+public class ErrorResponse {
+ /**
+ * Error code.
+ */
+ private String code;
+
+ /**
+ * Error message indicating why the operation failed.
+ */
+ private String message;
+
+ /**
+ * Get the code value.
+ *
+ * @return the code value
+ */
+ public String code() {
+ return this.code;
+ }
+
+ /**
+ * Set the code value.
+ *
+ * @param code the code value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get the message value.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message value.
+ *
+ * @param message the message value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponseException.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponseException.java
new file mode 100644
index 000000000000..e81e624a3ae3
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponseException.java
@@ -0,0 +1,87 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.microsoft.rest.RestException;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with ErrorResponse information.
+ */
+public class ErrorResponseException extends RestException {
+ /**
+ * Information about the associated HTTP response.
+ */
+ private Response response;
+ /**
+ * The actual response body.
+ */
+ private ErrorResponse body;
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ */
+ public ErrorResponseException() { }
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message The exception message.
+ */
+ public ErrorResponseException(final String message) {
+ super(message);
+ }
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message
+ * @param cause exception that caused this exception to occur
+ */
+ public ErrorResponseException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param cause exception that caused this exception to occur
+ */
+ public ErrorResponseException(final Throwable cause) {
+ super(cause);
+ }
+ /**
+ * Gets information about the associated HTTP response.
+ *
+ * @return the HTTP response
+ */
+ public Response getResponse() {
+ return response;
+ }
+ /**
+ * Gets the HTTP response body.
+ *
+ * @return the response body
+ */
+ public ErrorResponse getBody() {
+ return body;
+ }
+ /**
+ * Sets the HTTP response.
+ *
+ * @param response the HTTP response
+ */
+ public void setResponse(Response response) {
+ this.response = response;
+ }
+ /**
+ * Sets the HTTP response body.
+ *
+ * @param body the response body
+ */
+ public void setBody(ErrorResponse body) {
+ this.body = body;
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java
new file mode 100644
index 000000000000..6f43755b4169
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java
@@ -0,0 +1,97 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Geo filter of a CDN endpoint.
+ */
+public class GeoFilter {
+ /**
+ * Relative path applicable to geo filter. (e.g. '/mypictures',
+ * '/mypicture/kitty.jpg', and etc.).
+ */
+ @JsonProperty(required = true)
+ private String relativePath;
+
+ /**
+ * Action of the geo filter. Possible values include: 'Block', 'Allow'.
+ */
+ @JsonProperty(required = true)
+ private GeoFilterActions action;
+
+ /**
+ * Two letter country codes of the geo filter. (e.g. AU, MX, and etc.).
+ */
+ @JsonProperty(required = true)
+ private List countryCodes;
+
+ /**
+ * Get the relativePath value.
+ *
+ * @return the relativePath value
+ */
+ public String relativePath() {
+ return this.relativePath;
+ }
+
+ /**
+ * Set the relativePath value.
+ *
+ * @param relativePath the relativePath value to set
+ * @return the GeoFilter object itself.
+ */
+ public GeoFilter withRelativePath(String relativePath) {
+ this.relativePath = relativePath;
+ return this;
+ }
+
+ /**
+ * Get the action value.
+ *
+ * @return the action value
+ */
+ public GeoFilterActions action() {
+ return this.action;
+ }
+
+ /**
+ * Set the action value.
+ *
+ * @param action the action value to set
+ * @return the GeoFilter object itself.
+ */
+ public GeoFilter withAction(GeoFilterActions action) {
+ this.action = action;
+ return this;
+ }
+
+ /**
+ * Get the countryCodes value.
+ *
+ * @return the countryCodes value
+ */
+ public List countryCodes() {
+ return this.countryCodes;
+ }
+
+ /**
+ * Set the countryCodes value.
+ *
+ * @param countryCodes the countryCodes value to set
+ * @return the GeoFilter object itself.
+ */
+ public GeoFilter withCountryCodes(List countryCodes) {
+ this.countryCodes = countryCodes;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilterActions.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilterActions.java
new file mode 100644
index 000000000000..5377dc681235
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilterActions.java
@@ -0,0 +1,53 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for GeoFilterActions.
+ */
+public enum GeoFilterActions {
+ /** Enum value Block. */
+ BLOCK("Block"),
+
+ /** Enum value Allow. */
+ ALLOW("Allow");
+
+ /** The actual serialized value for a GeoFilterActions instance. */
+ private String value;
+
+ GeoFilterActions(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a GeoFilterActions instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed GeoFilterActions object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static GeoFilterActions fromString(String value) {
+ GeoFilterActions[] items = GeoFilterActions.values();
+ for (GeoFilterActions item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/LoadParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/LoadParameters.java
new file mode 100644
index 000000000000..535de63a3318
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/LoadParameters.java
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Parameters required for endpoint load.
+ */
+public class LoadParameters {
+ /**
+ * The path to the content to be loaded. Should describe a file path.
+ */
+ @JsonProperty(required = true)
+ private List contentPaths;
+
+ /**
+ * Get the contentPaths value.
+ *
+ * @return the contentPaths value
+ */
+ public List contentPaths() {
+ return this.contentPaths;
+ }
+
+ /**
+ * Set the contentPaths value.
+ *
+ * @param contentPaths the contentPaths value to set
+ * @return the LoadParameters object itself.
+ */
+ public LoadParameters withContentPaths(List contentPaths) {
+ this.contentPaths = contentPaths;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Operation.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Operation.java
new file mode 100644
index 000000000000..5113f84c745d
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Operation.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.microsoft.azure.management.apigeneration.LangDefinition;
+import com.microsoft.azure.management.cdn.implementation.OperationInner;
+
+/**
+ * Operation that CDN service supports.
+ */
+@LangDefinition
+public class Operation {
+ private OperationInner inner;
+
+ /**
+ * Construct Operation object from server response object.
+ *
+ * @param inner server response object containing supported operation description.
+ */
+ public Operation(OperationInner inner) {
+ this.inner = inner;
+ }
+
+ /**
+ * Get the name value.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.inner.name();
+ }
+
+ /**
+ * Get the provider value.
+ *
+ * @return the provider value
+ */
+ public String provider() {
+ if (this.inner.display() == null) {
+ return null;
+ }
+ return this.inner.display().provider();
+ }
+
+ /**
+ * Get the resource value.
+ *
+ * @return the resource value
+ */
+ public String resource() {
+ if (this.inner.display() == null) {
+ return null;
+ }
+ return this.inner.display().resource();
+ }
+
+ /**
+ * Get the operation value.
+ *
+ * @return the operation value
+ */
+ public String type() {
+ if (this.inner.display() == null) {
+ return null;
+ }
+ return this.inner.display().operation();
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OperationDisplay.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OperationDisplay.java
new file mode 100644
index 000000000000..9e5ff82202cd
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OperationDisplay.java
@@ -0,0 +1,91 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+
+/**
+ * The object that represents the operation.
+ */
+public class OperationDisplay {
+ /**
+ * Service provider: Microsoft.Cdn.
+ */
+ private String provider;
+
+ /**
+ * Resource on which the operation is performed: Profile, endpoint, etc.
+ */
+ private String resource;
+
+ /**
+ * Operation type: Read, write, delete, etc.
+ */
+ private String operation;
+
+ /**
+ * Get the provider value.
+ *
+ * @return the provider value
+ */
+ public String provider() {
+ return this.provider;
+ }
+
+ /**
+ * Set the provider value.
+ *
+ * @param provider the provider value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withProvider(String provider) {
+ this.provider = provider;
+ return this;
+ }
+
+ /**
+ * Get the resource value.
+ *
+ * @return the resource value
+ */
+ public String resource() {
+ return this.resource;
+ }
+
+ /**
+ * Set the resource value.
+ *
+ * @param resource the resource value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withResource(String resource) {
+ this.resource = resource;
+ return this;
+ }
+
+ /**
+ * Get the operation value.
+ *
+ * @return the operation value
+ */
+ public String operation() {
+ return this.operation;
+ }
+
+ /**
+ * Set the operation value.
+ *
+ * @param operation the operation value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withOperation(String operation) {
+ this.operation = operation;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginResourceState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginResourceState.java
new file mode 100644
index 000000000000..97b077d46f52
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginResourceState.java
@@ -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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for OriginResourceState.
+ */
+public final class OriginResourceState {
+ /** Static value Creating for OriginResourceState. */
+ public static final OriginResourceState CREATING = new OriginResourceState("Creating");
+
+ /** Static value Active for OriginResourceState. */
+ public static final OriginResourceState ACTIVE = new OriginResourceState("Active");
+
+ /** Static value Deleting for OriginResourceState. */
+ public static final OriginResourceState DELETING = new OriginResourceState("Deleting");
+
+ private String value;
+
+ /**
+ * Creates a custom value for OriginResourceState.
+ * @param value the custom value
+ */
+ public OriginResourceState(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof OriginResourceState)) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ OriginResourceState rhs = (OriginResourceState) obj;
+ if (value == null) {
+ return rhs.value == null;
+ } else {
+ return value.equals(rhs.value);
+ }
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileResourceState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileResourceState.java
new file mode 100644
index 000000000000..8c8bb0298a5f
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileResourceState.java
@@ -0,0 +1,65 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for ProfileResourceState.
+ */
+public final class ProfileResourceState {
+ /** Static value Creating for ProfileResourceState. */
+ public static final ProfileResourceState CREATING = new ProfileResourceState("Creating");
+
+ /** Static value Active for ProfileResourceState. */
+ public static final ProfileResourceState ACTIVE = new ProfileResourceState("Active");
+
+ /** Static value Deleting for ProfileResourceState. */
+ public static final ProfileResourceState DELETING = new ProfileResourceState("Deleting");
+
+ /** Static value Disabled for ProfileResourceState. */
+ public static final ProfileResourceState DISABLED = new ProfileResourceState("Disabled");
+
+ private String value;
+
+ /**
+ * Creates a custom value for ProfileResourceState.
+ * @param value the custom value
+ */
+ public ProfileResourceState(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof ProfileResourceState)) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ ProfileResourceState rhs = (ProfileResourceState) obj;
+ if (value == null) {
+ return rhs.value == null;
+ } else {
+ return value.equals(rhs.value);
+ }
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileUpdateParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileUpdateParameters.java
new file mode 100644
index 000000000000..b1560037484c
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileUpdateParameters.java
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Profile properties required for profile update.
+ */
+public class ProfileUpdateParameters {
+ /**
+ * Profile tags.
+ */
+ @JsonProperty(required = true)
+ private Map tags;
+
+ /**
+ * Get the tags value.
+ *
+ * @return the tags value
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags value.
+ *
+ * @param tags the tags value to set
+ * @return the ProfileUpdateParameters object itself.
+ */
+ public ProfileUpdateParameters withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/PurgeParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/PurgeParameters.java
new file mode 100644
index 000000000000..dd0b4bc77b06
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/PurgeParameters.java
@@ -0,0 +1,45 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Parameters required for endpoint purge.
+ */
+public class PurgeParameters {
+ /**
+ * The path to the content to be purged. Can describe a file path or a
+ * wild card directory.
+ */
+ @JsonProperty(required = true)
+ private List contentPaths;
+
+ /**
+ * Get the contentPaths value.
+ *
+ * @return the contentPaths value
+ */
+ public List contentPaths() {
+ return this.contentPaths;
+ }
+
+ /**
+ * Set the contentPaths value.
+ *
+ * @param contentPaths the contentPaths value to set
+ * @return the PurgeParameters object itself.
+ */
+ public PurgeParameters withContentPaths(List contentPaths) {
+ this.contentPaths = contentPaths;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/QueryStringCachingBehavior.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/QueryStringCachingBehavior.java
new file mode 100644
index 000000000000..0f54358c64ff
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/QueryStringCachingBehavior.java
@@ -0,0 +1,59 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for QueryStringCachingBehavior.
+ */
+public enum QueryStringCachingBehavior {
+ /** Enum value IgnoreQueryString. */
+ IGNORE_QUERY_STRING("IgnoreQueryString"),
+
+ /** Enum value BypassCaching. */
+ BYPASS_CACHING("BypassCaching"),
+
+ /** Enum value UseQueryString. */
+ USE_QUERY_STRING("UseQueryString"),
+
+ /** Enum value NotSet. */
+ NOT_SET("NotSet");
+
+ /** The actual serialized value for a QueryStringCachingBehavior instance. */
+ private String value;
+
+ QueryStringCachingBehavior(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a QueryStringCachingBehavior instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed QueryStringCachingBehavior object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static QueryStringCachingBehavior fromString(String value) {
+ QueryStringCachingBehavior[] items = QueryStringCachingBehavior.values();
+ for (QueryStringCachingBehavior item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ResourceType.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ResourceType.java
new file mode 100644
index 000000000000..69780c33acd7
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ResourceType.java
@@ -0,0 +1,50 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for ResourceType.
+ */
+public enum ResourceType {
+ /** Enum value Microsoft.Cdn/Profiles/Endpoints. */
+ MICROSOFT_CDN_PROFILES_ENDPOINTS("Microsoft.Cdn/Profiles/Endpoints");
+
+ /** The actual serialized value for a ResourceType instance. */
+ private String value;
+
+ ResourceType(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a ResourceType instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed ResourceType object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static ResourceType fromString(String value) {
+ ResourceType[] items = ResourceType.values();
+ for (ResourceType item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Sku.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Sku.java
new file mode 100644
index 000000000000..cd3c0110b0e2
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Sku.java
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+
+/**
+ * The SKU (pricing tier) of the CDN profile.
+ */
+public class Sku {
+ /**
+ * Name of the pricing tier. Possible values include: 'Standard_Verizon',
+ * 'Premium_Verizon', 'Custom_Verizon', 'Standard_Akamai',
+ * 'Standard_ChinaCdn'.
+ */
+ private SkuName name;
+
+ /**
+ * Get the name value.
+ *
+ * @return the name value
+ */
+ public SkuName name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name value.
+ *
+ * @param name the name value to set
+ * @return the Sku object itself.
+ */
+ public Sku withName(SkuName name) {
+ this.name = name;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/SkuName.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/SkuName.java
new file mode 100644
index 000000000000..d4203e2ee446
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/SkuName.java
@@ -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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for SkuName.
+ */
+public final class SkuName {
+ /** Static value Standard_Verizon for SkuName. */
+ public static final SkuName STANDARD_VERIZON = new SkuName("Standard_Verizon");
+
+ /** Static value Premium_Verizon for SkuName. */
+ public static final SkuName PREMIUM_VERIZON = new SkuName("Premium_Verizon");
+
+ /** Static value Custom_Verizon for SkuName. */
+ public static final SkuName CUSTOM_VERIZON = new SkuName("Custom_Verizon");
+
+ /** Static value Standard_Akamai for SkuName. */
+ public static final SkuName STANDARD_AKAMAI = new SkuName("Standard_Akamai");
+
+ /** Static value Standard_ChinaCdn for SkuName. */
+ public static final SkuName STANDARD_CHINA_CDN = new SkuName("Standard_ChinaCdn");
+
+ private String value;
+
+ /**
+ * Creates a custom value for SkuName.
+ * @param value the custom value
+ */
+ public SkuName(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof SkuName)) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ SkuName rhs = (SkuName) obj;
+ if (value == null) {
+ return rhs.value == null;
+ } else {
+ return value.equals(rhs.value);
+ }
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateCustomDomainInput.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateCustomDomainInput.java
new file mode 100644
index 000000000000..fc6bbdb7e612
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateCustomDomainInput.java
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Input of the custom domain to be validated.
+ */
+public class ValidateCustomDomainInput {
+ /**
+ * The host name of the custom domain. Must be a domain name.
+ */
+ @JsonProperty(required = true)
+ private String hostName;
+
+ /**
+ * Get the hostName value.
+ *
+ * @return the hostName value
+ */
+ public String hostName() {
+ return this.hostName;
+ }
+
+ /**
+ * Set the hostName value.
+ *
+ * @param hostName the hostName value to set
+ * @return the ValidateCustomDomainInput object itself.
+ */
+ public ValidateCustomDomainInput withHostName(String hostName) {
+ this.hostName = hostName;
+ return this;
+ }
+
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnEndpointImpl.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnEndpointImpl.java
new file mode 100644
index 000000000000..8bd5a2eb07bc
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnEndpointImpl.java
@@ -0,0 +1,543 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn.implementation;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.microsoft.azure.management.apigeneration.LangDefinition;
+import com.microsoft.azure.management.cdn.CdnEndpoint;
+import com.microsoft.azure.management.cdn.CdnProfile;
+import com.microsoft.azure.management.cdn.CustomDomainValidationResult;
+import com.microsoft.azure.management.cdn.DeepCreatedOrigin;
+import com.microsoft.azure.management.cdn.EndpointResourceState;
+import com.microsoft.azure.management.cdn.GeoFilter;
+import com.microsoft.azure.management.cdn.GeoFilterActions;
+import com.microsoft.azure.management.cdn.QueryStringCachingBehavior;
+import com.microsoft.azure.management.resources.fluentcore.arm.CountryISOCode;
+import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl;
+import com.microsoft.azure.management.resources.fluentcore.utils.ResourceNamer;
+import rx.Observable;
+import rx.functions.Action1;
+import rx.functions.Func1;
+import rx.functions.Func3;
+import rx.functions.FuncN;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Implementation for {@link CdnEndpoint}.
+ */
+@LangDefinition
+class CdnEndpointImpl extends ExternalChildResourceImpl
+ implements CdnEndpoint,
+
+ CdnEndpoint.DefinitionStages.Blank.StandardEndpoint,
+ CdnEndpoint.DefinitionStages.Blank.PremiumEndpoint,
+ CdnEndpoint.DefinitionStages.WithStandardAttach,
+ CdnEndpoint.DefinitionStages.WithPremiumAttach,
+
+ CdnEndpoint.UpdateDefinitionStages.Blank.StandardEndpoint,
+ CdnEndpoint.UpdateDefinitionStages.Blank.PremiumEndpoint,
+ CdnEndpoint.UpdateDefinitionStages.WithStandardAttach,
+ CdnEndpoint.UpdateDefinitionStages.WithPremiumAttach,
+
+ CdnEndpoint.UpdateStandardEndpoint,
+ CdnEndpoint.UpdatePremiumEndpoint {
+
+ private final EndpointsInner client;
+ private final OriginsInner originsClient;
+ private final CustomDomainsInner customDomainsClient;
+ private List customDomainList;
+ private List deletedCustomDomainList;
+
+ CdnEndpointImpl(String name,
+ CdnProfileImpl parent,
+ EndpointInner inner,
+ EndpointsInner client,
+ OriginsInner originsClient,
+ CustomDomainsInner customDomainsClient) {
+ super(name, parent, inner);
+ this.client = client;
+ this.originsClient = originsClient;
+ this.customDomainsClient = customDomainsClient;
+ this.customDomainList = new ArrayList();
+ this.deletedCustomDomainList = new ArrayList();
+ }
+
+ @Override
+ public String id() {
+ return this.inner().id();
+ }
+
+ @Override
+ public Observable createAsync() {
+ final CdnEndpointImpl self = this;
+ return this.client.createAsync(this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name(),
+ this.inner())
+ .map(new Func1() {
+ @Override
+ public CdnEndpoint call(EndpointInner inner) {
+ self.setInner(inner);
+ for (CustomDomainInner itemToCreate : self.customDomainList) {
+ self.customDomainsClient.create(
+ self.parent().resourceGroupName(),
+ self.parent().name(),
+ self.name(),
+ ResourceNamer.randomResourceName("CustomDomain", 50),
+ itemToCreate.hostName());
+ }
+ self.customDomainList.clear();
+ self.customDomainList.addAll(self.customDomainsClient.listByEndpoint(
+ self.parent().resourceGroupName(),
+ self.parent().name(),
+ self.name()));
+ return self;
+ }
+ });
+ }
+
+ @Override
+ public Observable updateAsync() {
+ final CdnEndpointImpl self = this;
+ EndpointUpdateParametersInner updateInner = new EndpointUpdateParametersInner();
+ updateInner.withIsHttpAllowed(this.inner().isHttpAllowed())
+ .withIsHttpsAllowed(this.inner().isHttpsAllowed())
+ .withOriginPath(this.inner().originPath())
+ .withOriginHostHeader(this.inner().originHostHeader())
+ .withIsCompressionEnabled(this.inner().isCompressionEnabled())
+ .withContentTypesToCompress(this.inner().contentTypesToCompress())
+ .withGeoFilters(this.inner().geoFilters())
+ .withOptimizationType(this.inner().optimizationType())
+ .withQueryStringCachingBehavior(this.inner().queryStringCachingBehavior())
+ .withTags(this.inner().getTags());
+
+ DeepCreatedOrigin originInner = this.inner().origins().get(0);
+ OriginUpdateParametersInner originParameters = new OriginUpdateParametersInner()
+ .withHostName(originInner.hostName())
+ .withHttpPort(originInner.httpPort())
+ .withHttpsPort(originInner.httpsPort());
+
+ Observable originObservable = this.originsClient.updateAsync(
+ this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name(),
+ originInner.name(),
+ originParameters);
+
+ Observable endpointObservable = this.client.updateAsync(
+ this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name(),
+ updateInner)
+ .map(new Func1() {
+ @Override
+ public CdnEndpoint call(EndpointInner inner) {
+ self.setInner(inner);
+ return self;
+ }
+ });
+
+ List> customDomainDeleteObservables = new ArrayList<>();
+
+ for (CustomDomainInner itemToDelete : this.deletedCustomDomainList) {
+ customDomainDeleteObservables.add(this.customDomainsClient.deleteAsync(
+ this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name(),
+ itemToDelete.name()));
+ }
+ Observable deleteObservable = Observable.zip(customDomainDeleteObservables, new FuncN() {
+ @Override
+ public CustomDomainInner call(Object... objects) {
+ return null;
+ }
+ });
+
+ return Observable.zip(
+ originObservable,
+ endpointObservable,
+ deleteObservable,
+ new Func3() {
+ @Override
+ public CdnEndpoint call(OriginInner originInner, CdnEndpoint cdnEndpoint, CustomDomainInner customDomain) {
+ return cdnEndpoint;
+ }
+ }).doOnNext(new Action1() {
+ @Override
+ public void call(CdnEndpoint cdnEndpoint) {
+ self.deletedCustomDomainList.clear();
+ }
+ });
+ }
+
+
+ @Override
+ public Observable deleteAsync() {
+ return this.client.deleteAsync(this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name()).map(new Func1() {
+ @Override
+ public Void call(Void result) {
+ return result;
+ }
+ });
+ }
+
+ @Override
+ public CdnEndpointImpl refresh() {
+ EndpointInner inner = this.client.get(this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name());
+ this.setInner(inner);
+ this.customDomainList.clear();
+ this.deletedCustomDomainList.clear();
+ this.customDomainList.addAll(this.customDomainsClient.listByEndpoint(
+ this.parent().resourceGroupName(),
+ this.parent().name(),
+ this.name()));
+ return this;
+ }
+
+ @Override
+ public CdnProfileImpl attach() {
+ return this.parent().withEndpoint(this);
+ }
+
+ @Override
+ public String originHostHeader() {
+ return this.inner().originHostHeader();
+ }
+
+ @Override
+ public String originPath() {
+ return this.inner().originPath();
+ }
+
+ @Override
+ public List contentTypesToCompress() {
+ return this.inner().contentTypesToCompress();
+ }
+
+ @Override
+ public boolean isCompressionEnabled() {
+ return this.inner().isCompressionEnabled();
+ }
+
+ @Override
+ public boolean isHttpAllowed() {
+ return this.inner().isHttpAllowed();
+ }
+
+ @Override
+ public boolean isHttpsAllowed() {
+ return this.inner().isHttpsAllowed();
+ }
+
+ @Override
+ public QueryStringCachingBehavior queryStringCachingBehavior() {
+ return this.inner().queryStringCachingBehavior();
+ }
+
+ @Override
+ public String optimizationType() {
+ return this.inner().optimizationType();
+ }
+
+ @Override
+ public List geoFilters() {
+ return this.inner().geoFilters();
+ }
+
+ @Override
+ public String hostName() {
+ return this.inner().hostName();
+ }
+
+ @Override
+ public EndpointResourceState resourceState() {
+ return this.inner().resourceState();
+ }
+
+ @Override
+ public String provisioningState() {
+ return this.inner().provisioningState();
+ }
+
+ @Override
+ public String originHostName() {
+ if (this.inner().origins() != null && !this.inner().origins().isEmpty()) {
+ return this.inner().origins().get(0).hostName();
+ }
+ return null;
+ }
+
+ @Override
+ public int httpPort() {
+ if (this.inner().origins() != null && !this.inner().origins().isEmpty()) {
+ return this.inner().origins().get(0).httpPort();
+ }
+ return 0;
+ }
+
+ @Override
+ public int httpsPort() {
+ if (this.inner().origins() != null && !this.inner().origins().isEmpty()) {
+ return this.inner().origins().get(0).httpsPort();
+ }
+ return 0;
+ }
+
+ @Override
+ public List customDomains() {
+ return Collections.unmodifiableList(
+ Lists.transform(this.customDomainList,
+ new Function() {
+ public String apply(CustomDomainInner customDomain) {
+ return customDomain.hostName();
+ }
+ }));
+ }
+
+ @Override
+ public void start() {
+ this.parent().startEndpoint(this.name());
+ }
+
+ @Override
+ public void stop() {
+ this.parent().stopEndpoint(this.name());
+ }
+
+ @Override
+ public void purgeContent(List contentPaths) {
+ this.parent().purgeEndpointContent(this.name(), contentPaths);
+ }
+
+ @Override
+ public void loadContent(List contentPaths) {
+ this.parent().loadEndpointContent(this.name(), contentPaths);
+ }
+
+ @Override
+ public CustomDomainValidationResult validateCustomDomain(String hostName) {
+ return this.parent().validateEndpointCustomDomain(this.name(), hostName);
+ }
+
+ @Override
+ public CdnEndpointImpl withOrigin(String originName, String hostname) {
+ this.inner().origins().add(
+ new DeepCreatedOrigin()
+ .withName(originName)
+ .withHostName(hostname));
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withOrigin(String hostname) {
+ return this.withOrigin("origin", hostname);
+ }
+
+ @Override
+ public CdnEndpointImpl withPremiumOrigin(String originName, String hostname) {
+ return this.withOrigin(originName, hostname);
+ }
+
+ @Override
+ public CdnEndpointImpl withPremiumOrigin(String hostname) {
+ return this.withOrigin(hostname);
+ }
+
+ @Override
+ public CdnEndpointImpl withOriginPath(String originPath) {
+ this.inner().withOriginPath(originPath);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withHttpAllowed(boolean httpAllowed) {
+ this.inner().withIsHttpAllowed(httpAllowed);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withHttpsAllowed(boolean httpsAllowed) {
+ this.inner().withIsHttpsAllowed(httpsAllowed);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withHttpPort(int httpPort) {
+ if (this.inner().origins() != null && !this.inner().origins().isEmpty()) {
+ this.inner().origins().get(0).withHttpPort(httpPort);
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withHttpsPort(int httpsPort) {
+ if (this.inner().origins() != null && !this.inner().origins().isEmpty()) {
+ this.inner().origins().get(0).withHttpsPort(httpsPort);
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withHostHeader(String hostHeader) {
+ this.inner().withOriginHostHeader(hostHeader);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withContentTypesToCompress(List contentTypesToCompress) {
+ this.inner().withContentTypesToCompress(contentTypesToCompress);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withoutContentTypesToCompress() {
+ if (this.inner().contentTypesToCompress() != null) {
+ this.inner().contentTypesToCompress().clear();
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withContentTypeToCompress(String contentTypeToCompress) {
+ if (this.inner().contentTypesToCompress() == null) {
+ this.inner().withContentTypesToCompress(new ArrayList());
+ }
+ this.inner().contentTypesToCompress().add(contentTypeToCompress);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withoutContentTypeToCompress(String contentTypeToCompress) {
+ if (this.inner().contentTypesToCompress() != null) {
+ this.inner().contentTypesToCompress().remove(contentTypeToCompress);
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withCompressionEnabled(boolean compressionEnabled) {
+ this.inner().withIsCompressionEnabled(compressionEnabled);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withQueryStringCachingBehavior(QueryStringCachingBehavior cachingBehavior) {
+ this.inner().withQueryStringCachingBehavior(cachingBehavior);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withGeoFilters(List geoFilters) {
+ this.inner().withGeoFilters(geoFilters);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withoutGeoFilters() {
+ if (this.inner().geoFilters() != null) {
+ this.inner().geoFilters().clear();
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withGeoFilter(String relativePath, GeoFilterActions action, CountryISOCode countryCode) {
+ GeoFilter geoFilter = this.createGeoFiltersObject(relativePath, action);
+
+ if (geoFilter.countryCodes() == null) {
+ geoFilter.withCountryCodes(new ArrayList());
+ }
+ geoFilter.countryCodes().add(countryCode.toString());
+
+ this.inner().geoFilters().add(geoFilter);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withGeoFilter(String relativePath, GeoFilterActions action, List countryCodes) {
+ GeoFilter geoFilter = this.createGeoFiltersObject(relativePath, action);
+
+ if (geoFilter.countryCodes() == null) {
+ geoFilter.withCountryCodes(new ArrayList());
+ } else {
+ geoFilter.countryCodes().isEmpty();
+ }
+
+ for (CountryISOCode countryCode : countryCodes) {
+ geoFilter.countryCodes().add(countryCode.toString());
+ }
+
+ this.inner().geoFilters().add(geoFilter);
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withoutGeoFilter(String relativePath) {
+ for (Iterator iter = this.inner().geoFilters().listIterator(); iter.hasNext();) {
+ GeoFilter geoFilter = iter.next();
+ if (geoFilter.relativePath().equals(relativePath)) {
+ iter.remove();
+ }
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withCustomDomain(String hostName) {
+ if (this.customDomainList != null) {
+ this.customDomainList.add(new CustomDomainInner().withHostName(hostName));
+ }
+ return this;
+ }
+
+ @Override
+ public CdnEndpointImpl withoutCustomDomain(String hostName) {
+ for (Iterator iter = this.customDomainList.listIterator(); iter.hasNext();) {
+ CustomDomainInner customDomain = iter.next();
+ if (hostName.equals(customDomain.hostName())) {
+ iter.remove();
+ deletedCustomDomainList.add(customDomain);
+ }
+ }
+ return this;
+ }
+
+ private GeoFilter createGeoFiltersObject(String relativePath, GeoFilterActions action) {
+ if (this.inner().geoFilters() == null) {
+ this.inner().withGeoFilters(new ArrayList());
+ }
+ GeoFilter geoFilter = null;
+ for (GeoFilter filter : this.inner().geoFilters()) {
+ if (filter.relativePath().equals(relativePath)) {
+ geoFilter = filter;
+ break;
+ }
+ }
+ if (geoFilter == null) {
+ geoFilter = new GeoFilter();
+ }
+ else {
+ this.inner().geoFilters().remove(geoFilter);
+ }
+ geoFilter.withRelativePath(relativePath)
+ .withAction(action);
+
+ return geoFilter;
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnEndpointsImpl.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnEndpointsImpl.java
new file mode 100644
index 000000000000..20c8098c99fb
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnEndpointsImpl.java
@@ -0,0 +1,156 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.cdn.implementation;
+
+import com.microsoft.azure.management.apigeneration.LangDefinition;
+import com.microsoft.azure.management.cdn.CdnEndpoint;
+import com.microsoft.azure.management.cdn.CdnProfile;
+import com.microsoft.azure.management.cdn.CheckNameAvailabilityResult;
+import com.microsoft.azure.management.cdn.DeepCreatedOrigin;
+import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesCachedImpl;
+import com.microsoft.azure.management.resources.fluentcore.utils.ResourceNamer;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Represents an endpoint collection associated with a CDN manager profile.
+ */
+@LangDefinition
+class CdnEndpointsImpl extends
+ ExternalChildResourcesCachedImpl {
+ private final EndpointsInner client;
+ private final OriginsInner originsClient;
+ private final CustomDomainsInner customDomainsClient;
+
+ CdnEndpointsImpl(EndpointsInner client,
+ OriginsInner originsClient,
+ CustomDomainsInner customDomainsClient,
+ CdnProfileImpl parent) {
+ super(parent, "Endpoint");
+ this.client = client;
+ this.originsClient = originsClient;
+ this.customDomainsClient = customDomainsClient;
+ }
+
+ /**
+ * @return the azure endpoints as a map indexed by name.
+ */
+ Map endpointsAsMap() {
+ Map result = new HashMap<>();
+ for (Map.Entry entry : this.collection().entrySet()) {
+ CdnEndpointImpl endpoint = entry.getValue();
+ result.put(entry.getKey(), endpoint);
+ }
+ return Collections.unmodifiableMap(result);
+ }
+
+ /**
+ * Mark the endpoint with given name as to be removed.
+ *
+ * @param name the name of the endpoint to be removed
+ */
+ public void remove(String name) {
+ this.prepareRemove(name);
+ }
+
+ /**
+ * Adds the endpoint to the collection.
+ *
+ * @param endpoint the endpoint
+ */
+ public void addEndpoint(CdnEndpointImpl endpoint) {
+ this.addChildResource(endpoint);
+ }
+
+ @Override
+ protected List listChildResources() {
+ List childResources = new ArrayList<>();
+
+ for (EndpointInner innerEndpoint : this.client.listByProfile(
+ this.parent().resourceGroupName(),
+ this.parent().name())) {
+ childResources.add(new CdnEndpointImpl(innerEndpoint.name(),
+ this.parent(),
+ innerEndpoint,
+ this.client,
+ this.originsClient,
+ this.customDomainsClient));
+ }
+ return Collections.unmodifiableList(childResources);
+ }
+
+ @Override
+ protected CdnEndpointImpl newChildResource(String name) {
+ CdnEndpointImpl endpoint = new CdnEndpointImpl(name,
+ this.parent(),
+ new EndpointInner(),
+ this.client,
+ this.originsClient,
+ this.customDomainsClient);
+
+ return endpoint;
+ }
+
+ public CdnEndpointImpl defineNewEndpoint(String endpointName, String originName, String endpointOriginHostname) {
+ CdnEndpointImpl endpoint = this.defineNewEndpoint(endpointName);
+ endpoint.inner().origins().add(
+ new DeepCreatedOrigin()
+ .withName(originName)
+ .withHostName(endpointOriginHostname));
+ return endpoint;
+ }
+
+ public CdnEndpointImpl defineNewEndpoint(String endpointName, String endpointOriginHostname) {
+ return this.defineNewEndpoint(endpointName, "origin", endpointOriginHostname);
+ }
+
+ public CdnEndpointImpl defineNewEndpoint(String name) {
+ CdnEndpointImpl endpoint = this.prepareDefine(name);
+ endpoint.inner().withLocation(endpoint.parent().region().toString());
+ endpoint.inner().withOrigins(new ArrayList());
+ return endpoint;
+ }
+
+
+ public CdnEndpointImpl defineNewEndpoint() {
+ String endpointName = this.generateUniqueEndpointName("Endpoint");
+ return this.defineNewEndpoint(endpointName);
+ }
+
+ public CdnEndpointImpl defineNewEndpointWithOriginHostname(String endpointOriginHostname) {
+ String endpointName = this.generateUniqueEndpointName("Endpoint");
+ CdnEndpointImpl endpoint = this.defineNewEndpoint(endpointName, "origin", endpointOriginHostname);
+ return endpoint;
+ }
+
+ public CdnEndpointImpl updateEndpoint(String name) {
+ CdnEndpointImpl endpoint = this.prepareUpdate(name);
+ return endpoint;
+ }
+
+ private String generateUniqueEndpointName(String endpointNamePrefix) {
+ String endpointName;
+ CheckNameAvailabilityResult result;
+
+ do {
+ endpointName = ResourceNamer.randomResourceName(endpointNamePrefix, 50);
+
+ result = this.parent().checkEndpointNameAvailability(endpointName);
+
+ } while (!result.nameAvailable());
+
+ return endpointName;
+ }
+}
diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnManagementClientImpl.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnManagementClientImpl.java
new file mode 100644
index 000000000000..39e7444ef9b7
--- /dev/null
+++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnManagementClientImpl.java
@@ -0,0 +1,565 @@
+/**
+ * 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.
+ */
+
+package com.microsoft.azure.management.cdn.implementation;
+
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.AzureClient;
+import com.microsoft.azure.AzureServiceCall;
+import com.microsoft.azure.AzureServiceClient;
+import com.microsoft.azure.AzureServiceResponseBuilder;
+import com.microsoft.azure.ListOperationCallback;
+import com.microsoft.azure.management.cdn.CheckNameAvailabilityInput;
+import com.microsoft.azure.management.cdn.ErrorResponseException;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.PagedList;
+import com.microsoft.azure.RestClient;
+import com.microsoft.rest.credentials.ServiceClientCredentials;
+import com.microsoft.rest.ServiceCall;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.POST;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * Initializes a new instance of the CdnManagementClientImpl class.
+ */
+public final class CdnManagementClientImpl extends AzureServiceClient {
+ /** The Retrofit service to perform REST calls. */
+ private CdnManagementClientService service;
+ /** the {@link AzureClient} used for long running operations. */
+ private AzureClient azureClient;
+
+ /**
+ * Gets the {@link AzureClient} used for long running operations.
+ * @return the azure client;
+ */
+ public AzureClient getAzureClient() {
+ return this.azureClient;
+ }
+
+ /** Azure Subscription ID. */
+ private String subscriptionId;
+
+ /**
+ * Gets Azure Subscription ID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String subscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * Sets Azure Subscription ID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the service client itself
+ */
+ public CdnManagementClientImpl withSubscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /** Version of the API to be used with the client request. Current version is 2016-10-02. */
+ private String apiVersion;
+
+ /**
+ * Gets Version of the API to be used with the client request. Current version is 2016-10-02.
+ *
+ * @return the apiVersion value.
+ */
+ public String apiVersion() {
+ return this.apiVersion;
+ }
+
+ /** Gets or sets the preferred language for the response. */
+ private String acceptLanguage;
+
+ /**
+ * Gets Gets or sets the preferred language for the response.
+ *
+ * @return the acceptLanguage value.
+ */
+ public String acceptLanguage() {
+ return this.acceptLanguage;
+ }
+
+ /**
+ * Sets Gets or sets the preferred language for the response.
+ *
+ * @param acceptLanguage the acceptLanguage value.
+ * @return the service client itself
+ */
+ public CdnManagementClientImpl withAcceptLanguage(String acceptLanguage) {
+ this.acceptLanguage = acceptLanguage;
+ return this;
+ }
+
+ /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
+ private int longRunningOperationRetryTimeout;
+
+ /**
+ * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @return the longRunningOperationRetryTimeout value.
+ */
+ public int longRunningOperationRetryTimeout() {
+ return this.longRunningOperationRetryTimeout;
+ }
+
+ /**
+ * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
+ * @return the service client itself
+ */
+ public CdnManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
+ this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
+ return this;
+ }
+
+ /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
+ private boolean generateClientRequestId;
+
+ /**
+ * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @return the generateClientRequestId value.
+ */
+ public boolean generateClientRequestId() {
+ return this.generateClientRequestId;
+ }
+
+ /**
+ * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @param generateClientRequestId the generateClientRequestId value.
+ * @return the service client itself
+ */
+ public CdnManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
+ this.generateClientRequestId = generateClientRequestId;
+ return this;
+ }
+
+ /**
+ * The ProfilesInner object to access its operations.
+ */
+ private ProfilesInner profiles;
+
+ /**
+ * Gets the ProfilesInner object to access its operations.
+ * @return the ProfilesInner object.
+ */
+ public ProfilesInner profiles() {
+ return this.profiles;
+ }
+
+ /**
+ * The EndpointsInner object to access its operations.
+ */
+ private EndpointsInner endpoints;
+
+ /**
+ * Gets the EndpointsInner object to access its operations.
+ * @return the EndpointsInner object.
+ */
+ public EndpointsInner endpoints() {
+ return this.endpoints;
+ }
+
+ /**
+ * The OriginsInner object to access its operations.
+ */
+ private OriginsInner origins;
+
+ /**
+ * Gets the OriginsInner object to access its operations.
+ * @return the OriginsInner object.
+ */
+ public OriginsInner origins() {
+ return this.origins;
+ }
+
+ /**
+ * The CustomDomainsInner object to access its operations.
+ */
+ private CustomDomainsInner customDomains;
+
+ /**
+ * Gets the CustomDomainsInner object to access its operations.
+ * @return the CustomDomainsInner object.
+ */
+ public CustomDomainsInner customDomains() {
+ return this.customDomains;
+ }
+
+ /**
+ * Initializes an instance of CdnManagementClient client.
+ *
+ * @param credentials the management credentials for Azure
+ */
+ public CdnManagementClientImpl(ServiceClientCredentials credentials) {
+ this("https://management.azure.com", credentials);
+ }
+
+ /**
+ * Initializes an instance of CdnManagementClient client.
+ *
+ * @param baseUrl the base URL of the host
+ * @param credentials the management credentials for Azure
+ */
+ public CdnManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) {
+ this(new RestClient.Builder()
+ .withBaseUrl(baseUrl)
+ .withCredentials(credentials)
+ .build());
+ }
+
+ /**
+ * Initializes an instance of CdnManagementClient client.
+ *
+ * @param restClient the REST client to connect to Azure.
+ */
+ public CdnManagementClientImpl(RestClient restClient) {
+ super(restClient);
+ initialize();
+ }
+
+ protected void initialize() {
+ this.apiVersion = "2016-10-02";
+ this.acceptLanguage = "en-US";
+ this.longRunningOperationRetryTimeout = 30;
+ this.generateClientRequestId = true;
+ this.profiles = new ProfilesInner(restClient().retrofit(), this);
+ this.endpoints = new EndpointsInner(restClient().retrofit(), this);
+ this.origins = new OriginsInner(restClient().retrofit(), this);
+ this.customDomains = new CustomDomainsInner(restClient().retrofit(), this);
+ this.azureClient = new AzureClient(this);
+ initializeService();
+ }
+
+ /**
+ * Gets the User-Agent header for the client.
+ *
+ * @return the user agent string.
+ */
+ @Override
+ public String userAgent() {
+ return String.format("Azure-SDK-For-Java/%s (%s)",
+ getClass().getPackage().getImplementationVersion(),
+ "CdnManagementClient, 2016-10-02");
+ }
+
+ private void initializeService() {
+ service = restClient().retrofit().create(CdnManagementClientService.class);
+ }
+
+ /**
+ * The interface defining all the services for CdnManagementClient to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface CdnManagementClientService {
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @POST("providers/Microsoft.Cdn/checkNameAvailability")
+ Observable> checkNameAvailability(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityInput checkNameAvailabilityInput, @Header("User-Agent") String userAgent);
+
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @GET("providers/Microsoft.Cdn/operations")
+ Observable> listOperations(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers("Content-Type: application/json; charset=utf-8")
+ @GET("{nextLink}")
+ Observable> listOperationsNext(@Path(value = "nextLink", encoded = true) String nextPageLink, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Check the availability of a resource name without creating the resource. This is needed for resources where name is globally unique, such as a CDN endpoint.
+ *
+ * @param name The resource name to validate.
+ * @return the CheckNameAvailabilityOutputInner object if successful.
+ */
+ public CheckNameAvailabilityOutputInner checkNameAvailability(String name) {
+ return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().getBody();
+ }
+
+ /**
+ * Check the availability of a resource name without creating the resource. This is needed for resources where name is globally unique, such as a CDN endpoint.
+ *
+ * @param name The resource name to validate.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @return the {@link ServiceCall} object
+ */
+ public ServiceCall checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) {
+ return ServiceCall.create(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback);
+ }
+
+ /**
+ * Check the availability of a resource name without creating the resource. This is needed for resources where name is globally unique, such as a CDN endpoint.
+ *
+ * @param name The resource name to validate.
+ * @return the observable to the CheckNameAvailabilityOutputInner object
+ */
+ public Observable checkNameAvailabilityAsync(String name) {
+ return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityOutputInner>() {
+ @Override
+ public CheckNameAvailabilityOutputInner call(ServiceResponse response) {
+ return response.getBody();
+ }
+ });
+ }
+
+ /**
+ * Check the availability of a resource name without creating the resource. This is needed for resources where name is globally unique, such as a CDN endpoint.
+ *
+ * @param name The resource name to validate.
+ * @return the observable to the CheckNameAvailabilityOutputInner object
+ */
+ public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) {
+ if (this.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
+ }
+ if (name == null) {
+ throw new IllegalArgumentException("Parameter name is required and cannot be null.");
+ }
+ CheckNameAvailabilityInput checkNameAvailabilityInput = new CheckNameAvailabilityInput();
+ checkNameAvailabilityInput.withName(name);
+ return service.checkNameAvailability(this.apiVersion(), this.acceptLanguage(), checkNameAvailabilityInput, this.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = checkNameAvailabilityDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return new AzureServiceResponseBuilder(this.mapperAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @return the PagedList<OperationInner> object if successful.
+ */
+ public PagedList listOperations() {
+ ServiceResponse> response = listOperationsSinglePageAsync().toBlocking().single();
+ return new PagedList(response.getBody()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody();
+ }
+ };
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @return the {@link ServiceCall} object
+ */
+ public ServiceCall> listOperationsAsync(final ListOperationCallback serviceCallback) {
+ return AzureServiceCall.create(
+ listOperationsSinglePageAsync(),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listOperationsNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @return the observable to the PagedList<OperationInner> object
+ */
+ public Observable> listOperationsAsync() {
+ return listOperationsWithServiceResponseAsync()
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.getBody();
+ }
+ });
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @return the observable to the PagedList<OperationInner> object
+ */
+ public Observable>> listOperationsWithServiceResponseAsync() {
+ return listOperationsSinglePageAsync()
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.getBody().getNextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listOperationsNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listOperationsSinglePageAsync() {
+ if (this.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
+ }
+ return service.listOperations(this.apiVersion(), this.acceptLanguage(), this.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listOperationsDelegate(response);
+ return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse> listOperationsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return new AzureServiceResponseBuilder, ErrorResponseException>(this.mapperAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @return the PagedList<OperationInner> object if successful.
+ */
+ public PagedList listOperationsNext(final String nextPageLink) {
+ ServiceResponse> response = listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single();
+ return new PagedList(response.getBody()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody();
+ }
+ };
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @param serviceCall the ServiceCall object tracking the Retrofit calls
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @return the {@link ServiceCall} object
+ */
+ public ServiceCall> listOperationsNextAsync(final String nextPageLink, final ServiceCall> serviceCall, final ListOperationCallback serviceCallback) {
+ return AzureServiceCall.create(
+ listOperationsNextSinglePageAsync(nextPageLink),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listOperationsNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @return the observable to the PagedList<OperationInner> object
+ */
+ public Observable> listOperationsNextAsync(final String nextPageLink) {
+ return listOperationsNextWithServiceResponseAsync(nextPageLink)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.getBody();
+ }
+ });
+ }
+
+ /**
+ * Lists all of the available CDN REST API operations.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @return the observable to the PagedList<OperationInner> object
+ */
+ public Observable