From b950d6d2689309db83a09e7f210b7972a881a1c7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 13 Aug 2018 17:41:33 +0000 Subject: [PATCH] Generated from 8b60f3bd649da2d300d260eefccbc22b7b4a417d adding standard_microsoft in pricing tier --- .../cdn/CacheExpirationActionParameters.java | 132 ++ .../cdn/CheckNameAvailabilityInput.java | 77 + .../azure/management/cdn/CidrIpAddress.java | 69 + .../cdn/CustomDomainParameters.java | 45 + .../cdn/CustomDomainResourceState.java | 44 + .../cdn/CustomHttpsProvisioningState.java | 50 + .../cdn/CustomHttpsProvisioningSubstate.java | 65 + .../management/cdn/DeepCreatedOrigin.java | 124 + .../azure/management/cdn/DeliveryRule.java | 102 + .../management/cdn/DeliveryRuleAction.java | 24 + .../DeliveryRuleCacheExpirationAction.java | 47 + .../management/cdn/DeliveryRuleCondition.java | 25 + ...DeliveryRuleUrlFileExtensionCondition.java | 47 + .../cdn/DeliveryRuleUrlPathCondition.java | 47 + ...pertiesUpdateParametersDeliveryPolicy.java | 70 + .../management/cdn/EndpointResourceState.java | 53 + .../cdn/EndpointUpdateParameters.java | 357 +++ .../azure/management/cdn/ErrorResponse.java | 48 + .../cdn/ErrorResponseException.java | 44 + .../azure/management/cdn/GeoFilter.java | 99 + .../management/cdn/GeoFilterActions.java | 53 + .../azure/management/cdn/IpAddressGroup.java | 96 + .../azure/management/cdn/LoadParameters.java | 45 + .../management/cdn/OperationDisplay.java | 62 + .../management/cdn/OptimizationType.java | 50 + .../management/cdn/OriginResourceState.java | 44 + .../cdn/OriginUpdateParameters.java | 98 + .../management/cdn/ProfileResourceState.java | 47 + .../cdn/ProfileUpdateParameters.java | 44 + .../azure/management/cdn/PurgeParameters.java | 45 + .../cdn/QueryStringCachingBehavior.java | 59 + .../azure/management/cdn/ResourceType.java | 50 + .../microsoft/azure/management/cdn/Sku.java | 46 + .../azure/management/cdn/SkuName.java | 53 + .../UrlFileExtensionConditionParameters.java | 78 + .../cdn/UrlPathConditionParameters.java | 105 + .../cdn/ValidateCustomDomainInput.java | 43 + .../management/cdn/ValidateProbeInput.java | 43 + .../CdnManagementClientImpl.java | 565 +++++ .../CheckNameAvailabilityOutputInner.java | 62 + .../cdn/implementation/CustomDomainInner.java | 149 ++ .../implementation/CustomDomainsInner.java | 1035 ++++++++ .../cdn/implementation/EdgeNodeInner.java | 49 + .../cdn/implementation/EdgeNodesInner.java | 283 +++ .../cdn/implementation/EndpointInner.java | 412 ++++ .../cdn/implementation/EndpointsInner.java | 2080 +++++++++++++++++ .../cdn/implementation/OperationInner.java | 59 + .../cdn/implementation/OperationsInner.java | 283 +++ .../cdn/implementation/OriginInner.java | 133 ++ .../cdn/implementation/OriginsInner.java | 628 +++++ .../cdn/implementation/PageImpl.java | 75 + .../cdn/implementation/ProfileInner.java | 81 + .../cdn/implementation/ProfilesInner.java | 1719 ++++++++++++++ .../implementation/ResourceUsageInner.java | 77 + .../implementation/ResourceUsagesInner.java | 288 +++ .../cdn/implementation/SsoUriInner.java | 32 + ...ortedOptimizationTypesListResultInner.java | 34 + .../ValidateCustomDomainOutputInner.java | 62 + .../ValidateProbeOutputInner.java | 62 + .../cdn/implementation/package-info.java | 11 + .../azure/management/cdn/package-info.java | 11 + 61 files changed, 10820 insertions(+) create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CacheExpirationActionParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityInput.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CidrIpAddress.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainResourceState.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningState.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningSubstate.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeepCreatedOrigin.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRule.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleAction.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCacheExpirationAction.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCondition.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlFileExtensionCondition.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlPathCondition.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointPropertiesUpdateParametersDeliveryPolicy.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointResourceState.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointUpdateParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponse.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponseException.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilterActions.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/IpAddressGroup.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/LoadParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OperationDisplay.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OptimizationType.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginResourceState.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginUpdateParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileResourceState.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileUpdateParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/PurgeParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/QueryStringCachingBehavior.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ResourceType.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Sku.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/SkuName.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlFileExtensionConditionParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlPathConditionParameters.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateCustomDomainInput.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateProbeInput.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnManagementClientImpl.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CheckNameAvailabilityOutputInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodeInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodesInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointsInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationsInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginsInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/PageImpl.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfileInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfilesInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsageInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsagesInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SsoUriInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SupportedOptimizationTypesListResultInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateCustomDomainOutputInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateProbeOutputInner.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/package-info.java create mode 100644 azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/package-info.java diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CacheExpirationActionParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CacheExpirationActionParameters.java new file mode 100644 index 0000000000000..7e125721bca5c --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CacheExpirationActionParameters.java @@ -0,0 +1,132 @@ +/** + * 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; + +/** + * Defines the parameters for the cache expiration action. + */ +public class CacheExpirationActionParameters { + /** + * The odatatype property. + */ + @JsonProperty(value = "@odata\\.type", required = true) + private String odatatype; + + /** + * Caching behavior for the requests that include query strings. Possible + * values include: 'BypassCache', 'Override', 'SetIfMissing'. + */ + @JsonProperty(value = "cacheBehavior", required = true) + private String cacheBehavior; + + /** + * The level at which the content needs to be cached. + */ + @JsonProperty(value = "cacheType", required = true) + private String cacheType; + + /** + * The duration for which the the content needs to be cached. Allowed + * format is [d.]hh:mm:ss. + */ + @JsonProperty(value = "cacheDuration") + private String cacheDuration; + + /** + * Creates an instance of CacheExpirationActionParameters class. + * @param cacheBehavior caching behavior for the requests that include query strings. Possible values include: 'BypassCache', 'Override', 'SetIfMissing'. + */ + public CacheExpirationActionParameters() { + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"; + cacheType = "All"; + } + + /** + * Get the odatatype value. + * + * @return the odatatype value + */ + public String odatatype() { + return this.odatatype; + } + + /** + * Set the odatatype value. + * + * @param odatatype the odatatype value to set + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withOdatatype(String odatatype) { + this.odatatype = odatatype; + return this; + } + + /** + * Get caching behavior for the requests that include query strings. Possible values include: 'BypassCache', 'Override', 'SetIfMissing'. + * + * @return the cacheBehavior value + */ + public String cacheBehavior() { + return this.cacheBehavior; + } + + /** + * Set caching behavior for the requests that include query strings. Possible values include: 'BypassCache', 'Override', 'SetIfMissing'. + * + * @param cacheBehavior the cacheBehavior value to set + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheBehavior(String cacheBehavior) { + this.cacheBehavior = cacheBehavior; + return this; + } + + /** + * Get the level at which the content needs to be cached. + * + * @return the cacheType value + */ + public String cacheType() { + return this.cacheType; + } + + /** + * Set the level at which the content needs to be cached. + * + * @param cacheType the cacheType value to set + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheType(String cacheType) { + this.cacheType = cacheType; + return this; + } + + /** + * Get the duration for which the the content needs to be cached. Allowed format is [d.]hh:mm:ss. + * + * @return the cacheDuration value + */ + public String cacheDuration() { + return this.cacheDuration; + } + + /** + * Set the duration for which the the content needs to be cached. Allowed format is [d.]hh:mm:ss. + * + * @param cacheDuration the cacheDuration value to set + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheDuration(String cacheDuration) { + this.cacheDuration = cacheDuration; + return this; + } + +} 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 0000000000000..ca8808537827a --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CheckNameAvailabilityInput.java @@ -0,0 +1,77 @@ +/** + * 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(value = "name", required = true) + private String name; + + /** + * The type of the resource whose name is to be validated. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityInput class. + * @param name the resource name to validate. + */ + public CheckNameAvailabilityInput() { + type = "Microsoft.Cdn/Profiles/Endpoints"; + } + + /** + * Get the resource name to validate. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the resource name to validate. + * + * @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 of the resource whose name is to be validated. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the resource whose name is to be validated. + * + * @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/CidrIpAddress.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CidrIpAddress.java new file mode 100644 index 0000000000000..1f45a206d8346 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CidrIpAddress.java @@ -0,0 +1,69 @@ +/** + * 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; + +/** + * CIDR Ip address. + */ +public class CidrIpAddress { + /** + * Ip adress itself. + */ + @JsonProperty(value = "baseIpAddress") + private String baseIpAddress; + + /** + * The length of the prefix of the ip address. + */ + @JsonProperty(value = "prefixLength") + private Integer prefixLength; + + /** + * Get ip adress itself. + * + * @return the baseIpAddress value + */ + public String baseIpAddress() { + return this.baseIpAddress; + } + + /** + * Set ip adress itself. + * + * @param baseIpAddress the baseIpAddress value to set + * @return the CidrIpAddress object itself. + */ + public CidrIpAddress withBaseIpAddress(String baseIpAddress) { + this.baseIpAddress = baseIpAddress; + return this; + } + + /** + * Get the length of the prefix of the ip address. + * + * @return the prefixLength value + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the length of the prefix of the ip address. + * + * @param prefixLength the prefixLength value to set + * @return the CidrIpAddress object itself. + */ + public CidrIpAddress withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + +} 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 0000000000000..2d4a009dda2c2 --- /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 host name of the custom domain. Must be a domain name. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set the host name of the custom domain. Must be a domain name. + * + * @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 0000000000000..fc00f10f62f6b --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainResourceState.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.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CustomDomainResourceState. + */ +public final class CustomDomainResourceState extends ExpandableStringEnum { + /** Static value Creating for CustomDomainResourceState. */ + public static final CustomDomainResourceState CREATING = fromString("Creating"); + + /** Static value Active for CustomDomainResourceState. */ + public static final CustomDomainResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for CustomDomainResourceState. */ + public static final CustomDomainResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a CustomDomainResourceState from its string representation. + * @param name a name to look for + * @return the corresponding CustomDomainResourceState + */ + @JsonCreator + public static CustomDomainResourceState fromString(String name) { + return fromString(name, CustomDomainResourceState.class); + } + + /** + * @return known CustomDomainResourceState values + */ + public static Collection values() { + return values(CustomDomainResourceState.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningState.java new file mode 100644 index 0000000000000..d61cb4fca09ad --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningState.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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CustomHttpsProvisioningState. + */ +public final class CustomHttpsProvisioningState extends ExpandableStringEnum { + /** Static value Enabling for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState ENABLING = fromString("Enabling"); + + /** Static value Enabled for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState ENABLED = fromString("Enabled"); + + /** Static value Disabling for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState DISABLING = fromString("Disabling"); + + /** Static value Disabled for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState DISABLED = fromString("Disabled"); + + /** Static value Failed for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a CustomHttpsProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding CustomHttpsProvisioningState + */ + @JsonCreator + public static CustomHttpsProvisioningState fromString(String name) { + return fromString(name, CustomHttpsProvisioningState.class); + } + + /** + * @return known CustomHttpsProvisioningState values + */ + public static Collection values() { + return values(CustomHttpsProvisioningState.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningSubstate.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningSubstate.java new file mode 100644 index 0000000000000..2adc5e15adebe --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomHttpsProvisioningSubstate.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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CustomHttpsProvisioningSubstate. + */ +public final class CustomHttpsProvisioningSubstate extends ExpandableStringEnum { + /** Static value SubmittingDomainControlValidationRequest for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate SUBMITTING_DOMAIN_CONTROL_VALIDATION_REQUEST = fromString("SubmittingDomainControlValidationRequest"); + + /** Static value PendingDomainControlValidationREquestApproval for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate PENDING_DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVAL = fromString("PendingDomainControlValidationREquestApproval"); + + /** Static value DomainControlValidationRequestApproved for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVED = fromString("DomainControlValidationRequestApproved"); + + /** Static value DomainControlValidationRequestRejected for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_REJECTED = fromString("DomainControlValidationRequestRejected"); + + /** Static value DomainControlValidationRequestTimedOut for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_TIMED_OUT = fromString("DomainControlValidationRequestTimedOut"); + + /** Static value IssuingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate ISSUING_CERTIFICATE = fromString("IssuingCertificate"); + + /** Static value DeployingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DEPLOYING_CERTIFICATE = fromString("DeployingCertificate"); + + /** Static value CertificateDeployed for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DEPLOYED = fromString("CertificateDeployed"); + + /** Static value DeletingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DELETING_CERTIFICATE = fromString("DeletingCertificate"); + + /** Static value CertificateDeleted for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DELETED = fromString("CertificateDeleted"); + + /** + * Creates or finds a CustomHttpsProvisioningSubstate from its string representation. + * @param name a name to look for + * @return the corresponding CustomHttpsProvisioningSubstate + */ + @JsonCreator + public static CustomHttpsProvisioningSubstate fromString(String name) { + return fromString(name, CustomHttpsProvisioningSubstate.class); + } + + /** + * @return known CustomHttpsProvisioningSubstate values + */ + public static Collection values() { + return values(CustomHttpsProvisioningSubstate.class); + } +} 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 0000000000000..0cf9858facb7a --- /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; + +/** + * The main origin of CDN content which is added when creating a CDN endpoint. + */ +@JsonFlatten +public class DeepCreatedOrigin { + /** + * Origin name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The address of the origin. It can be a domain name, IPv4 address, or + * IPv6 address. + */ + @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 origin name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set origin name. + * + * @param name the name value to set + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withName(String name) { + this.name = name; + return this; + } + + /** + * Get the address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set the address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * + * @param hostName the hostName value to set + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get the value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the value of the HTTPS port. Must be between 1 and 65535. + * + * @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/DeliveryRule.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRule.java new file mode 100644 index 0000000000000..161eddb408b49 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRule.java @@ -0,0 +1,102 @@ +/** + * 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; + +/** + * A rule that specifies a set of actions and conditions. + */ +public class DeliveryRule { + /** + * The order in which the rules are applied for the endpoint. Possible + * values {0,1,2,3,………}. A rule with a lesser order will be applied before + * a rule with a greater order. Rule with order 0 is a special rule. It + * does not require any condition and actions listed in it will always be + * applied. + */ + @JsonProperty(value = "order", required = true) + private int order; + + /** + * A list of actions that are executed when all the conditions of a rule + * are satisfied. + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /** + * A list of conditions that must be matched for the actions to be + * executed. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /** + * Get the order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value + */ + public int order() { + return this.order; + } + + /** + * Set the order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set + * @return the DeliveryRule object itself. + */ + public DeliveryRule withOrder(int order) { + this.order = order; + return this; + } + + /** + * Get a list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set a list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set + * @return the DeliveryRule object itself. + */ + public DeliveryRule withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get a list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value + */ + public List conditions() { + return this.conditions; + } + + /** + * Set a list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set + * @return the DeliveryRule object itself. + */ + public DeliveryRule withConditions(List conditions) { + this.conditions = conditions; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleAction.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleAction.java new file mode 100644 index 0000000000000..6b834df10c020 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleAction.java @@ -0,0 +1,24 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * An action for the delivery rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("DeliveryRuleAction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "CacheExpiration", value = DeliveryRuleCacheExpirationAction.class) +}) +public class DeliveryRuleAction { +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCacheExpirationAction.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCacheExpirationAction.java new file mode 100644 index 0000000000000..366d25638af93 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCacheExpirationAction.java @@ -0,0 +1,47 @@ +/** + * 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.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the cache expiration action for the delivery rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("CacheExpiration") +public class DeliveryRuleCacheExpirationAction extends DeliveryRuleAction { + /** + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private CacheExpirationActionParameters parameters; + + /** + * Get defines the parameters for the action. + * + * @return the parameters value + */ + public CacheExpirationActionParameters parameters() { + return this.parameters; + } + + /** + * Set defines the parameters for the action. + * + * @param parameters the parameters value to set + * @return the DeliveryRuleCacheExpirationAction object itself. + */ + public DeliveryRuleCacheExpirationAction withParameters(CacheExpirationActionParameters parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCondition.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCondition.java new file mode 100644 index 0000000000000..d65e8b4eee914 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleCondition.java @@ -0,0 +1,25 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * A condition for the delivery rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("DeliveryRuleCondition") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "UrlPath", value = DeliveryRuleUrlPathCondition.class), + @JsonSubTypes.Type(name = "UrlFileExtension", value = DeliveryRuleUrlFileExtensionCondition.class) +}) +public class DeliveryRuleCondition { +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlFileExtensionCondition.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlFileExtensionCondition.java new file mode 100644 index 0000000000000..41150001d5cab --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlFileExtensionCondition.java @@ -0,0 +1,47 @@ +/** + * 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.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the URL file extension condition for the delivery rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlFileExtension") +public class DeliveryRuleUrlFileExtensionCondition extends DeliveryRuleCondition { + /** + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlFileExtensionConditionParameters parameters; + + /** + * Get defines the parameters for the condition. + * + * @return the parameters value + */ + public UrlFileExtensionConditionParameters parameters() { + return this.parameters; + } + + /** + * Set defines the parameters for the condition. + * + * @param parameters the parameters value to set + * @return the DeliveryRuleUrlFileExtensionCondition object itself. + */ + public DeliveryRuleUrlFileExtensionCondition withParameters(UrlFileExtensionConditionParameters parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlPathCondition.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlPathCondition.java new file mode 100644 index 0000000000000..b6dd9b29cc2e7 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/DeliveryRuleUrlPathCondition.java @@ -0,0 +1,47 @@ +/** + * 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.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the URL path condition for the delivery rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlPath") +public class DeliveryRuleUrlPathCondition extends DeliveryRuleCondition { + /** + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlPathConditionParameters parameters; + + /** + * Get defines the parameters for the condition. + * + * @return the parameters value + */ + public UrlPathConditionParameters parameters() { + return this.parameters; + } + + /** + * Set defines the parameters for the condition. + * + * @param parameters the parameters value to set + * @return the DeliveryRuleUrlPathCondition object itself. + */ + public DeliveryRuleUrlPathCondition withParameters(UrlPathConditionParameters parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointPropertiesUpdateParametersDeliveryPolicy.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointPropertiesUpdateParametersDeliveryPolicy.java new file mode 100644 index 0000000000000..33e647f1497fd --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointPropertiesUpdateParametersDeliveryPolicy.java @@ -0,0 +1,70 @@ +/** + * 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; + +/** + * A policy that specifies the delivery rules to be used for an endpoint. + */ +public class EndpointPropertiesUpdateParametersDeliveryPolicy { + /** + * User-friendly description of the policy. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A list of the delivery rules. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get user-friendly description of the policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user-friendly description of the policy. + * + * @param description the description value to set + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a list of the delivery rules. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set a list of the delivery rules. + * + * @param rules the rules value to set + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withRules(List rules) { + this.rules = rules; + 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 0000000000000..ee2659887500a --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointResourceState.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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointResourceState. + */ +public final class EndpointResourceState extends ExpandableStringEnum { + /** Static value Creating for EndpointResourceState. */ + public static final EndpointResourceState CREATING = fromString("Creating"); + + /** Static value Deleting for EndpointResourceState. */ + public static final EndpointResourceState DELETING = fromString("Deleting"); + + /** Static value Running for EndpointResourceState. */ + public static final EndpointResourceState RUNNING = fromString("Running"); + + /** Static value Starting for EndpointResourceState. */ + public static final EndpointResourceState STARTING = fromString("Starting"); + + /** Static value Stopped for EndpointResourceState. */ + public static final EndpointResourceState STOPPED = fromString("Stopped"); + + /** Static value Stopping for EndpointResourceState. */ + public static final EndpointResourceState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a EndpointResourceState from its string representation. + * @param name a name to look for + * @return the corresponding EndpointResourceState + */ + @JsonCreator + public static EndpointResourceState fromString(String name) { + return fromString(name, EndpointResourceState.class); + } + + /** + * @return known EndpointResourceState values + */ + public static Collection values() { + return values(EndpointResourceState.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointUpdateParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointUpdateParameters.java new file mode 100644 index 0000000000000..6d021524cbbe1 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/EndpointUpdateParameters.java @@ -0,0 +1,357 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Properties required to create or update an endpoint. + */ +@JsonFlatten +public class EndpointUpdateParameters { + /** + * Endpoint tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The host header value sent to the origin with each request. If you leave + * this blank, the request hostname determines this value. Azure CDN + * origins, such as Web Apps, Blob Storage, and Cloud Services require this + * host header value to match the origin hostname by default. + */ + @JsonProperty(value = "properties.originHostHeader") + private String originHostHeader; + + /** + * A directory path on the origin that CDN can use to retreive content + * from, e.g. contoso.cloudapp.net/originpath. + */ + @JsonProperty(value = "properties.originPath") + private String originPath; + + /** + * List of content types on which compression applies. The value should be + * a valid MIME type. + */ + @JsonProperty(value = "properties.contentTypesToCompress") + private List contentTypesToCompress; + + /** + * Indicates whether content compression is enabled on CDN. Default value + * is false. If compression is enabled, content will be served as + * compressed if user requests for a compressed version. Content won't be + * compressed on CDN when requested content is smaller than 1 byte or + * larger than 1 MB. + */ + @JsonProperty(value = "properties.isCompressionEnabled") + private Boolean isCompressionEnabled; + + /** + * Indicates whether HTTP traffic is allowed on the endpoint. Default value + * is true. At least one protocol (HTTP or HTTPS) must be allowed. + */ + @JsonProperty(value = "properties.isHttpAllowed") + private Boolean isHttpAllowed; + + /** + * Indicates whether HTTPS traffic is allowed on the endpoint. Default + * value is true. At least one protocol (HTTP or HTTPS) must be allowed. + */ + @JsonProperty(value = "properties.isHttpsAllowed") + private Boolean isHttpsAllowed; + + /** + * Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent + * requests that contain query strings from being cached, or cache every + * request with a unique URL. Possible values include: 'IgnoreQueryString', + * 'BypassCaching', 'UseQueryString', 'NotSet'. + */ + @JsonProperty(value = "properties.queryStringCachingBehavior") + private QueryStringCachingBehavior queryStringCachingBehavior; + + /** + * Specifies what scenario the customer wants this CDN endpoint to optimize + * for, e.g. Download, Media services. With this information, CDN can apply + * scenario driven optimization. Possible values include: + * 'GeneralWebDelivery', 'GeneralMediaStreaming', + * 'VideoOnDemandMediaStreaming', 'LargeFileDownload', + * 'DynamicSiteAcceleration'. + */ + @JsonProperty(value = "properties.optimizationType") + private OptimizationType optimizationType; + + /** + * Path to a file hosted on the origin which helps accelerate delivery of + * the dynamic content and calculate the most optimal routes for the CDN. + * This is relative to the origin path. + */ + @JsonProperty(value = "properties.probePath") + private String probePath; + + /** + * List of rules defining the user's geo access within a CDN endpoint. Each + * geo filter defines an acess rule to a specified path or content, e.g. + * block APAC for path /pictures/. + */ + @JsonProperty(value = "properties.geoFilters") + private List geoFilters; + + /** + * A policy that specifies the delivery rules to be used for an endpoint. + */ + @JsonProperty(value = "properties.deliveryPolicy") + private EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy; + + /** + * Get endpoint tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set endpoint tags. + * + * @param tags the tags value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get a directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value + */ + public String originPath() { + return this.originPath; + } + + /** + * Set a directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get list of content types on which compression applies. The value should be a valid MIME type. + * + * @return the contentTypesToCompress value + */ + public List contentTypesToCompress() { + return this.contentTypesToCompress; + } + + /** + * Set list of content types on which compression applies. The value should be a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withContentTypesToCompress(List contentTypesToCompress) { + this.contentTypesToCompress = contentTypesToCompress; + return this; + } + + /** + * Get indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value + */ + public Boolean isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsCompressionEnabled(Boolean isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Get indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value + */ + public Boolean isHttpAllowed() { + return this.isHttpAllowed; + } + + /** + * Set indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsHttpAllowed(Boolean isHttpAllowed) { + this.isHttpAllowed = isHttpAllowed; + return this; + } + + /** + * Get indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value + */ + public Boolean isHttpsAllowed() { + return this.isHttpsAllowed; + } + + /** + * Set indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsHttpsAllowed(Boolean isHttpsAllowed) { + this.isHttpsAllowed = isHttpsAllowed; + return this; + } + + /** + * Get defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'. + * + * @return the queryStringCachingBehavior value + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration'. + * + * @return the optimizationType value + */ + public OptimizationType optimizationType() { + return this.optimizationType; + } + + /** + * Set specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration'. + * + * @param optimizationType the optimizationType value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOptimizationType(OptimizationType optimizationType) { + this.optimizationType = optimizationType; + return this; + } + + /** + * Get path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. + * + * @return the probePath value + */ + public String probePath() { + return this.probePath; + } + + /** + * Set path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. + * + * @param probePath the probePath value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + + /** + * Get list of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value + */ + public List geoFilters() { + return this.geoFilters; + } + + /** + * Set list of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withGeoFilters(List geoFilters) { + this.geoFilters = geoFilters; + return this; + } + + /** + * Get a policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.deliveryPolicy; + } + + /** + * Set a policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + this.deliveryPolicy = deliveryPolicy; + return this; + } + +} 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 0000000000000..585c2ef4d8dd5 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponse.java @@ -0,0 +1,48 @@ +/** + * 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; + +/** + * 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. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} 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 0000000000000..9a2b8bb828836 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponseException.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 com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.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 0000000000000..48c10b5d04ca0 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java @@ -0,0 +1,99 @@ +/** + * 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; + +/** + * Rules defining user's geo access within a CDN endpoint. + */ +public class GeoFilter { + /** + * Relative path applicable to geo filter. (e.g. '/mypictures', + * '/mypicture/kitty.jpg', and etc.). + */ + @JsonProperty(value = "relativePath", required = true) + private String relativePath; + + /** + * Action of the geo filter, i.e. allow or block access. Possible values + * include: 'Block', 'Allow'. + */ + @JsonProperty(value = "action", required = true) + private GeoFilterActions action; + + /** + * Two letter country codes defining user country access in a geo filter, + * e.g. AU, MX, US. + */ + @JsonProperty(value = "countryCodes", required = true) + private List countryCodes; + + /** + * Get relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.). + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.). + * + * @param relativePath the relativePath value to set + * @return the GeoFilter object itself. + */ + public GeoFilter withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get action of the geo filter, i.e. allow or block access. Possible values include: 'Block', 'Allow'. + * + * @return the action value + */ + public GeoFilterActions action() { + return this.action; + } + + /** + * Set action of the geo filter, i.e. allow or block access. Possible values include: 'Block', 'Allow'. + * + * @param action the action value to set + * @return the GeoFilter object itself. + */ + public GeoFilter withAction(GeoFilterActions action) { + this.action = action; + return this; + } + + /** + * Get two letter country codes defining user country access in a geo filter, e.g. AU, MX, US. + * + * @return the countryCodes value + */ + public List countryCodes() { + return this.countryCodes; + } + + /** + * Set two letter country codes defining user country access in a geo filter, e.g. AU, MX, US. + * + * @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 0000000000000..5377dc681235a --- /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/IpAddressGroup.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/IpAddressGroup.java new file mode 100644 index 0000000000000..eb61cdf5f62a7 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/IpAddressGroup.java @@ -0,0 +1,96 @@ +/** + * 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; + +/** + * CDN Ip address group. + */ +public class IpAddressGroup { + /** + * The delivery region of the ip address group. + */ + @JsonProperty(value = "deliveryRegion") + private String deliveryRegion; + + /** + * The list of ip v4 addresses. + */ + @JsonProperty(value = "ipv4Addresses") + private List ipv4Addresses; + + /** + * The list of ip v6 addresses. + */ + @JsonProperty(value = "ipv6Addresses") + private List ipv6Addresses; + + /** + * Get the delivery region of the ip address group. + * + * @return the deliveryRegion value + */ + public String deliveryRegion() { + return this.deliveryRegion; + } + + /** + * Set the delivery region of the ip address group. + * + * @param deliveryRegion the deliveryRegion value to set + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withDeliveryRegion(String deliveryRegion) { + this.deliveryRegion = deliveryRegion; + return this; + } + + /** + * Get the list of ip v4 addresses. + * + * @return the ipv4Addresses value + */ + public List ipv4Addresses() { + return this.ipv4Addresses; + } + + /** + * Set the list of ip v4 addresses. + * + * @param ipv4Addresses the ipv4Addresses value to set + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withIpv4Addresses(List ipv4Addresses) { + this.ipv4Addresses = ipv4Addresses; + return this; + } + + /** + * Get the list of ip v6 addresses. + * + * @return the ipv6Addresses value + */ + public List ipv6Addresses() { + return this.ipv6Addresses; + } + + /** + * Set the list of ip v6 addresses. + * + * @param ipv6Addresses the ipv6Addresses value to set + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withIpv6Addresses(List ipv6Addresses) { + this.ipv6Addresses = ipv6Addresses; + return this; + } + +} 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 0000000000000..3669530d4591b --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/LoadParameters.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 content load. + */ +public class LoadParameters { + /** + * The path to the content to be loaded. Path should be a relative file URL + * of the origin. + */ + @JsonProperty(value = "contentPaths", required = true) + private List contentPaths; + + /** + * Get the path to the content to be loaded. Path should be a relative file URL of the origin. + * + * @return the contentPaths value + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the path to the content to be loaded. Path should be a relative file URL of the origin. + * + * @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/OperationDisplay.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OperationDisplay.java new file mode 100644 index 0000000000000..774062d608c83 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OperationDisplay.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.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.Cdn. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Get service provider: Microsoft.Cdn. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OptimizationType.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OptimizationType.java new file mode 100644 index 0000000000000..6b93492362edd --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OptimizationType.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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OptimizationType. + */ +public final class OptimizationType extends ExpandableStringEnum { + /** Static value GeneralWebDelivery for OptimizationType. */ + public static final OptimizationType GENERAL_WEB_DELIVERY = fromString("GeneralWebDelivery"); + + /** Static value GeneralMediaStreaming for OptimizationType. */ + public static final OptimizationType GENERAL_MEDIA_STREAMING = fromString("GeneralMediaStreaming"); + + /** Static value VideoOnDemandMediaStreaming for OptimizationType. */ + public static final OptimizationType VIDEO_ON_DEMAND_MEDIA_STREAMING = fromString("VideoOnDemandMediaStreaming"); + + /** Static value LargeFileDownload for OptimizationType. */ + public static final OptimizationType LARGE_FILE_DOWNLOAD = fromString("LargeFileDownload"); + + /** Static value DynamicSiteAcceleration for OptimizationType. */ + public static final OptimizationType DYNAMIC_SITE_ACCELERATION = fromString("DynamicSiteAcceleration"); + + /** + * Creates or finds a OptimizationType from its string representation. + * @param name a name to look for + * @return the corresponding OptimizationType + */ + @JsonCreator + public static OptimizationType fromString(String name) { + return fromString(name, OptimizationType.class); + } + + /** + * @return known OptimizationType values + */ + public static Collection values() { + return values(OptimizationType.class); + } +} 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 0000000000000..dba08f9469592 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginResourceState.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.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OriginResourceState. + */ +public final class OriginResourceState extends ExpandableStringEnum { + /** Static value Creating for OriginResourceState. */ + public static final OriginResourceState CREATING = fromString("Creating"); + + /** Static value Active for OriginResourceState. */ + public static final OriginResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for OriginResourceState. */ + public static final OriginResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a OriginResourceState from its string representation. + * @param name a name to look for + * @return the corresponding OriginResourceState + */ + @JsonCreator + public static OriginResourceState fromString(String name) { + return fromString(name, OriginResourceState.class); + } + + /** + * @return known OriginResourceState values + */ + public static Collection values() { + return values(OriginResourceState.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginUpdateParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginUpdateParameters.java new file mode 100644 index 0000000000000..4990012ecb471 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OriginUpdateParameters.java @@ -0,0 +1,98 @@ +/** + * 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; + +/** + * Origin properties needed for origin creation or update. + */ +@JsonFlatten +public class OriginUpdateParameters { + /** + * The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported. + */ + @JsonProperty(value = "properties.hostName") + 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 address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set the address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. + * + * @param hostName the hostName value to set + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get the value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + +} 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 0000000000000..f14955f7b839c --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileResourceState.java @@ -0,0 +1,47 @@ +/** + * 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.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProfileResourceState. + */ +public final class ProfileResourceState extends ExpandableStringEnum { + /** Static value Creating for ProfileResourceState. */ + public static final ProfileResourceState CREATING = fromString("Creating"); + + /** Static value Active for ProfileResourceState. */ + public static final ProfileResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for ProfileResourceState. */ + public static final ProfileResourceState DELETING = fromString("Deleting"); + + /** Static value Disabled for ProfileResourceState. */ + public static final ProfileResourceState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ProfileResourceState from its string representation. + * @param name a name to look for + * @return the corresponding ProfileResourceState + */ + @JsonCreator + public static ProfileResourceState fromString(String name) { + return fromString(name, ProfileResourceState.class); + } + + /** + * @return known ProfileResourceState values + */ + public static Collection values() { + return values(ProfileResourceState.class); + } +} 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 0000000000000..9d549fc760a09 --- /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; + +/** + * Properties required to update a profile. + */ +public class ProfileUpdateParameters { + /** + * Profile tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get profile tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set profile tags. + * + * @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 0000000000000..421f015b32e44 --- /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 content purge. + */ +public class PurgeParameters { + /** + * The path to the content to be purged. Can describe a file path or a wild + * card directory. + */ + @JsonProperty(value = "contentPaths", required = true) + private List contentPaths; + + /** + * Get the path to the content to be purged. Can describe a file path or a wild card directory. + * + * @return the contentPaths value + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the path to the content to be purged. Can describe a file path or a wild card directory. + * + * @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 0000000000000..0f54358c64ff7 --- /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 0000000000000..69780c33acd74 --- /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 0000000000000..6b3197dd8017e --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/Sku.java @@ -0,0 +1,46 @@ +/** + * 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; + +/** + * The pricing tier (defines a CDN provider, feature list and rate) 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', 'Standard_Microsoft'. + */ + @JsonProperty(value = "name") + private SkuName name; + + /** + * Get name of the pricing tier. Possible values include: 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon', 'Standard_Akamai', 'Standard_ChinaCdn', 'Standard_Microsoft'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set name of the pricing tier. Possible values include: 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon', 'Standard_Akamai', 'Standard_ChinaCdn', 'Standard_Microsoft'. + * + * @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 0000000000000..e5b14b804a267 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/SkuName.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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Standard_Verizon for SkuName. */ + public static final SkuName STANDARD_VERIZON = fromString("Standard_Verizon"); + + /** Static value Premium_Verizon for SkuName. */ + public static final SkuName PREMIUM_VERIZON = fromString("Premium_Verizon"); + + /** Static value Custom_Verizon for SkuName. */ + public static final SkuName CUSTOM_VERIZON = fromString("Custom_Verizon"); + + /** Static value Standard_Akamai for SkuName. */ + public static final SkuName STANDARD_AKAMAI = fromString("Standard_Akamai"); + + /** Static value Standard_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_CHINA_CDN = fromString("Standard_ChinaCdn"); + + /** Static value Standard_Microsoft for SkuName. */ + public static final SkuName STANDARD_MICROSOFT = fromString("Standard_Microsoft"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlFileExtensionConditionParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlFileExtensionConditionParameters.java new file mode 100644 index 0000000000000..f53f269d89b3b --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlFileExtensionConditionParameters.java @@ -0,0 +1,78 @@ +/** + * 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; + +/** + * Defines the parameters for the URL file extension condition. + */ +public class UrlFileExtensionConditionParameters { + /** + * The odatatype property. + */ + @JsonProperty(value = "@odata\\.type", required = true) + private String odatatype; + + /** + * A list of extensions for the condition of the delivery rule. + */ + @JsonProperty(value = "extensions", required = true) + private List extensions; + + /** + * Creates an instance of UrlFileExtensionConditionParameters class. + * @param extensions a list of extensions for the condition of the delivery rule. + */ + public UrlFileExtensionConditionParameters() { + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionConditionParameters"; + } + + /** + * Get the odatatype value. + * + * @return the odatatype value + */ + public String odatatype() { + return this.odatatype; + } + + /** + * Set the odatatype value. + * + * @param odatatype the odatatype value to set + * @return the UrlFileExtensionConditionParameters object itself. + */ + public UrlFileExtensionConditionParameters withOdatatype(String odatatype) { + this.odatatype = odatatype; + return this; + } + + /** + * Get a list of extensions for the condition of the delivery rule. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set a list of extensions for the condition of the delivery rule. + * + * @param extensions the extensions value to set + * @return the UrlFileExtensionConditionParameters object itself. + */ + public UrlFileExtensionConditionParameters withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlPathConditionParameters.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlPathConditionParameters.java new file mode 100644 index 0000000000000..b773262087917 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlPathConditionParameters.java @@ -0,0 +1,105 @@ +/** + * 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; + +/** + * Defines the parameters for the URL path condition. + */ +public class UrlPathConditionParameters { + /** + * The odatatype property. + */ + @JsonProperty(value = "@odata\\.type", required = true) + private String odatatype; + + /** + * A URL path for the condition of the delivery rule. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /** + * The match type for the condition of the delivery rule. Possible values + * include: 'Literal', 'Wildcard'. + */ + @JsonProperty(value = "matchType", required = true) + private String matchType; + + /** + * Creates an instance of UrlPathConditionParameters class. + * @param path a URL path for the condition of the delivery rule. + * @param matchType the match type for the condition of the delivery rule. Possible values include: 'Literal', 'Wildcard'. + */ + public UrlPathConditionParameters() { + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathConditionParameters"; + } + + /** + * Get the odatatype value. + * + * @return the odatatype value + */ + public String odatatype() { + return this.odatatype; + } + + /** + * Set the odatatype value. + * + * @param odatatype the odatatype value to set + * @return the UrlPathConditionParameters object itself. + */ + public UrlPathConditionParameters withOdatatype(String odatatype) { + this.odatatype = odatatype; + return this; + } + + /** + * Get a URL path for the condition of the delivery rule. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set a URL path for the condition of the delivery rule. + * + * @param path the path value to set + * @return the UrlPathConditionParameters object itself. + */ + public UrlPathConditionParameters withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the match type for the condition of the delivery rule. Possible values include: 'Literal', 'Wildcard'. + * + * @return the matchType value + */ + public String matchType() { + return this.matchType; + } + + /** + * Set the match type for the condition of the delivery rule. Possible values include: 'Literal', 'Wildcard'. + * + * @param matchType the matchType value to set + * @return the UrlPathConditionParameters object itself. + */ + public UrlPathConditionParameters withMatchType(String matchType) { + this.matchType = matchType; + return this; + } + +} 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 0000000000000..5a0020d2220c1 --- /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 for DNS mapping. + */ +public class ValidateCustomDomainInput { + /** + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostName; + + /** + * Get the host name of the custom domain. Must be a domain name. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set the host name of the custom domain. Must be a domain name. + * + * @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/ValidateProbeInput.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateProbeInput.java new file mode 100644 index 0000000000000..1548ad7bc0180 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateProbeInput.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 validate probe API. + */ +public class ValidateProbeInput { + /** + * The probe URL to validate. + */ + @JsonProperty(value = "probeURL", required = true) + private String probeURL; + + /** + * Get the probe URL to validate. + * + * @return the probeURL value + */ + public String probeURL() { + return this.probeURL; + } + + /** + * Set the probe URL to validate. + * + * @param probeURL the probeURL value to set + * @return the ValidateProbeInput object itself. + */ + public ValidateProbeInput withProbeURL(String probeURL) { + this.probeURL = probeURL; + return this; + } + +} 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 0000000000000..43af20dc3430c --- /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.AzureServiceClient; +import com.microsoft.azure.management.cdn.CheckNameAvailabilityInput; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.management.cdn.ValidateProbeInput; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +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 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 2017-04-02. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. Current version is 2017-04-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; + } + + /** + * The ResourceUsagesInner object to access its operations. + */ + private ResourceUsagesInner resourceUsages; + + /** + * Gets the ResourceUsagesInner object to access its operations. + * @return the ResourceUsagesInner object. + */ + public ResourceUsagesInner resourceUsages() { + return this.resourceUsages; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The EdgeNodesInner object to access its operations. + */ + private EdgeNodesInner edgeNodes; + + /** + * Gets the EdgeNodesInner object to access its operations. + * @return the EdgeNodesInner object. + */ + public EdgeNodesInner edgeNodes() { + return this.edgeNodes; + } + + /** + * 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) { + super(baseUrl, credentials); + initialize(); + } + + /** + * 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 = "2017-10-12"; + 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.resourceUsages = new ResourceUsagesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.edgeNodes = new EdgeNodesInner(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("%s (%s, %s)", super.userAgent(), "CdnManagementClient", "2017-10-12"); + } + + 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", "x-ms-logging-context: com.microsoft.azure.management.cdn.CdnManagementClient checkNameAvailability" }) + @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", "x-ms-logging-context: com.microsoft.azure.management.cdn.CdnManagementClient checkNameAvailabilityWithSubscription" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability") + Observable> checkNameAvailabilityWithSubscription(@Path("subscriptionId") String subscriptionId, @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", "x-ms-logging-context: com.microsoft.azure.management.cdn.CdnManagementClient validateProbe" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe") + Observable> validateProbe(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ValidateProbeInput validateProbeInput, @Header("User-Agent") String userAgent); + + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityOutputInner object if successful. + */ + public CheckNameAvailabilityOutputInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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.body(); + } + }); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityOutputInner object if successful. + */ + public CheckNameAvailabilityOutputInner checkNameAvailabilityWithSubscription(String name) { + return checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityWithSubscriptionAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable checkNameAvailabilityWithSubscriptionAsync(String name) { + return checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityOutputInner>() { + @Override + public CheckNameAvailabilityOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. + * + * @param name The resource name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable> checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(String name) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + 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.checkNameAvailabilityWithSubscription(this.subscriptionId(), this.apiVersion(), this.acceptLanguage(), checkNameAvailabilityInput, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityWithSubscriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityWithSubscriptionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. + * + * @param probeURL The probe URL to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateProbeOutputInner object if successful. + */ + public ValidateProbeOutputInner validateProbe(String probeURL) { + return validateProbeWithServiceResponseAsync(probeURL).toBlocking().single().body(); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. + * + * @param probeURL The probe URL to validate. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateProbeAsync(String probeURL, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateProbeWithServiceResponseAsync(probeURL), serviceCallback); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. + * + * @param probeURL The probe URL to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateProbeOutputInner object + */ + public Observable validateProbeAsync(String probeURL) { + return validateProbeWithServiceResponseAsync(probeURL).map(new Func1, ValidateProbeOutputInner>() { + @Override + public ValidateProbeOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. + * + * @param probeURL The probe URL to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateProbeOutputInner object + */ + public Observable> validateProbeWithServiceResponseAsync(String probeURL) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (probeURL == null) { + throw new IllegalArgumentException("Parameter probeURL is required and cannot be null."); + } + ValidateProbeInput validateProbeInput = new ValidateProbeInput(); + validateProbeInput.withProbeURL(probeURL); + return service.validateProbe(this.subscriptionId(), this.apiVersion(), this.acceptLanguage(), validateProbeInput, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateProbeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateProbeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CheckNameAvailabilityOutputInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CheckNameAvailabilityOutputInner.java new file mode 100644 index 0000000000000..b958f0de91f4a --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CheckNameAvailabilityOutputInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of check name availability API. + */ +public class CheckNameAvailabilityOutputInner { + /** + * Indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason why the name is not available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * The detailed error message describing why the name is not available. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason why the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get the detailed error message describing why the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainInner.java new file mode 100644 index 0000000000000..9e783d9771822 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainInner.java @@ -0,0 +1,149 @@ +/** + * 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.microsoft.azure.management.cdn.CustomDomainResourceState; +import com.microsoft.azure.management.cdn.CustomHttpsProvisioningState; +import com.microsoft.azure.management.cdn.CustomHttpsProvisioningSubstate; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Friendly domain name mapping to the endpoint hostname that the customer + * provides for branding purposes, e.g. www.consoto.com. + */ +@JsonFlatten +public class CustomDomainInner extends ProxyResource { + /** + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "properties.hostName", required = true) + private String hostName; + + /** + * Resource status of the custom domain. Possible values include: + * 'Creating', 'Active', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomainResourceState resourceState; + + /** + * Provisioning status of Custom Https of the custom domain. Possible + * values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Failed'. + */ + @JsonProperty(value = "properties.customHttpsProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningState customHttpsProvisioningState; + + /** + * Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. Possible values include: + * 'SubmittingDomainControlValidationRequest', + * 'PendingDomainControlValidationREquestApproval', + * 'DomainControlValidationRequestApproved', + * 'DomainControlValidationRequestRejected', + * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + * 'CertificateDeleted'. + */ + @JsonProperty(value = "properties.customHttpsProvisioningSubstate", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate; + + /** + * Special validation or data may be required when delivering CDN to some + * regions due to local compliance reasons. E.g. ICP license number of a + * custom domain is required to deliver content in China. + */ + @JsonProperty(value = "properties.validationData") + private String validationData; + + /** + * Provisioning status of the custom domain. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the host name of the custom domain. Must be a domain name. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set the host name of the custom domain. Must be a domain name. + * + * @param hostName the hostName value to set + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get resource status of the custom domain. Possible values include: 'Creating', 'Active', 'Deleting'. + * + * @return the resourceState value + */ + public CustomDomainResourceState resourceState() { + return this.resourceState; + } + + /** + * Get provisioning status of Custom Https of the custom domain. Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed'. + * + * @return the customHttpsProvisioningState value + */ + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.customHttpsProvisioningState; + } + + /** + * Get provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted'. + * + * @return the customHttpsProvisioningSubstate value + */ + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.customHttpsProvisioningSubstate; + } + + /** + * Get special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. + * + * @return the validationData value + */ + public String validationData() { + return this.validationData; + } + + /** + * Set special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. + * + * @param validationData the validationData value to set + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withValidationData(String validationData) { + this.validationData = validationData; + return this; + } + + /** + * Get provisioning status of the custom domain. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java new file mode 100644 index 0000000000000..2e432e52acac1 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CustomDomainsInner.java @@ -0,0 +1,1035 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.CustomDomainParameters; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +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.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CustomDomains. + */ +public class CustomDomainsInner { + /** The Retrofit service to perform REST calls. */ + private CustomDomainsService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of CustomDomainsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CustomDomainsInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(CustomDomainsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CustomDomains to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomDomainsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains listByEndpoint" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains") + Observable> listByEndpoint(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CustomDomainParameters customDomainProperties, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CustomDomainParameters customDomainProperties, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains disableCustomHttps" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps") + Observable> disableCustomHttps(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains enableCustomHttps" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps") + Observable> enableCustomHttps(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("customDomainName") String customDomainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CustomDomains listByEndpointNext" }) + @GET + Observable> listByEndpointNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomDomainInner> object if successful. + */ + public PagedList listByEndpoint(final String resourceGroupName, final String profileName, final String endpointName) { + ServiceResponse> response = listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByEndpointAsync(final String resourceGroupName, final String profileName, final String endpointName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainInner> object + */ + public Observable> listByEndpointAsync(final String resourceGroupName, final String profileName, final String endpointName) { + return listByEndpointWithServiceResponseAsync(resourceGroupName, profileName, endpointName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainInner> object + */ + public Observable>> listByEndpointWithServiceResponseAsync(final String resourceGroupName, final String profileName, final String endpointName) { + return listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByEndpointNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group. + ServiceResponse> * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomDomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEndpointSinglePageAsync(final String resourceGroupName, final String profileName, final String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByEndpoint(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEndpointDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEndpointDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an exisitng custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner get(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).toBlocking().single().body(); + } + + /** + * Gets an exisitng custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName), serviceCallback); + } + + /** + * Gets an exisitng custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an exisitng custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner create(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName) { + return createWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, hostName).toBlocking().last().body(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, hostName), serviceCallback); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName) { + return createWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, hostName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + } + CustomDomainParameters customDomainProperties = new CustomDomainParameters(); + customDomainProperties.withHostName(hostName); + Observable> observable = service.create(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), customDomainProperties, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner beginCreate(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName) { + return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, hostName).toBlocking().single().body(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, hostName), serviceCallback); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName) { + return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, hostName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, String hostName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + } + CustomDomainParameters customDomainProperties = new CustomDomainParameters(); + customDomainProperties.withHostName(hostName); + return service.beginCreate(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), customDomainProperties, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner delete(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).toBlocking().last().body(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName), serviceCallback); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner beginDelete(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).toBlocking().single().body(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName), serviceCallback); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable beginDeleteAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner disableCustomHttps(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return disableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).toBlocking().single().body(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableCustomHttpsAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName), serviceCallback); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable disableCustomHttpsAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return disableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable> disableCustomHttpsWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableCustomHttpsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableCustomHttpsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomDomainInner object if successful. + */ + public CustomDomainInner enableCustomHttps(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return enableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).toBlocking().single().body(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableCustomHttpsAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName), serviceCallback); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable enableCustomHttpsAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return enableCustomHttpsWithServiceResponseAsync(resourceGroupName, profileName, endpointName, customDomainName).map(new Func1, CustomDomainInner>() { + @Override + public CustomDomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomDomainInner object + */ + public Observable> enableCustomHttpsWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String customDomainName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (customDomainName == null) { + throw new IllegalArgumentException("Parameter customDomainName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableCustomHttpsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableCustomHttpsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomDomainInner> object if successful. + */ + public PagedList listByEndpointNext(final String nextPageLink) { + ServiceResponse> response = listByEndpointNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByEndpointNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEndpointNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainInner> object + */ + public Observable> listByEndpointNextAsync(final String nextPageLink) { + return listByEndpointNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomDomainInner> object + */ + public Observable>> listByEndpointNextWithServiceResponseAsync(final String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByEndpointNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomDomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEndpointNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByEndpointNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEndpointNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEndpointNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodeInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodeInner.java new file mode 100644 index 0000000000000..969b2e118277b --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodeInner.java @@ -0,0 +1,49 @@ +/** + * 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 java.util.List; +import com.microsoft.azure.management.cdn.IpAddressGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Edgenode is a global Point of Presence (POP) location used to deliver CDN + * content to end users. + */ +@JsonFlatten +public class EdgeNodeInner extends ProxyResource { + /** + * List of ip address groups. + */ + @JsonProperty(value = "properties.ipAddressGroups", required = true) + private List ipAddressGroups; + + /** + * Get list of ip address groups. + * + * @return the ipAddressGroups value + */ + public List ipAddressGroups() { + return this.ipAddressGroups; + } + + /** + * Set list of ip address groups. + * + * @param ipAddressGroups the ipAddressGroups value to set + * @return the EdgeNodeInner object itself. + */ + public EdgeNodeInner withIpAddressGroups(List ipAddressGroups) { + this.ipAddressGroups = ipAddressGroups; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodesInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodesInner.java new file mode 100644 index 0000000000000..e7130879fde53 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EdgeNodesInner.java @@ -0,0 +1,283 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EdgeNodes. + */ +public class EdgeNodesInner { + /** The Retrofit service to perform REST calls. */ + private EdgeNodesService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of EdgeNodesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EdgeNodesInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(EdgeNodesService.class); + this.client = client; + } + + /** + * The interface defining all the services for EdgeNodes to be + * used by Retrofit to perform actually REST calls. + */ + interface EdgeNodesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.EdgeNodes list" }) + @GET("providers/Microsoft.Cdn/edgenodes") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.EdgeNodes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EdgeNodeInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EdgeNodeInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EdgeNodeInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EdgeNodeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EdgeNodeInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EdgeNodeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EdgeNodeInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EdgeNodeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointInner.java new file mode 100644 index 0000000000000..a7813cc9c61a4 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointInner.java @@ -0,0 +1,412 @@ +/** + * 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 java.util.List; +import com.microsoft.azure.management.cdn.QueryStringCachingBehavior; +import com.microsoft.azure.management.cdn.OptimizationType; +import com.microsoft.azure.management.cdn.GeoFilter; +import com.microsoft.azure.management.cdn.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.microsoft.azure.management.cdn.DeepCreatedOrigin; +import com.microsoft.azure.management.cdn.EndpointResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * CDN endpoint is the entity within a CDN profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + * The CDN endpoint uses the URL format <endpointname>.azureedge.net. + */ +@JsonFlatten +public class EndpointInner extends Resource { + /** + * The host header value sent to the origin with each request. If you leave + * this blank, the request hostname determines this value. Azure CDN + * origins, such as Web Apps, Blob Storage, and Cloud Services require this + * host header value to match the origin hostname by default. + */ + @JsonProperty(value = "properties.originHostHeader") + private String originHostHeader; + + /** + * A directory path on the origin that CDN can use to retreive content + * from, e.g. contoso.cloudapp.net/originpath. + */ + @JsonProperty(value = "properties.originPath") + private String originPath; + + /** + * List of content types on which compression applies. The value should be + * a valid MIME type. + */ + @JsonProperty(value = "properties.contentTypesToCompress") + private List contentTypesToCompress; + + /** + * Indicates whether content compression is enabled on CDN. Default value + * is false. If compression is enabled, content will be served as + * compressed if user requests for a compressed version. Content won't be + * compressed on CDN when requested content is smaller than 1 byte or + * larger than 1 MB. + */ + @JsonProperty(value = "properties.isCompressionEnabled") + private Boolean isCompressionEnabled; + + /** + * Indicates whether HTTP traffic is allowed on the endpoint. Default value + * is true. At least one protocol (HTTP or HTTPS) must be allowed. + */ + @JsonProperty(value = "properties.isHttpAllowed") + private Boolean isHttpAllowed; + + /** + * Indicates whether HTTPS traffic is allowed on the endpoint. Default + * value is true. At least one protocol (HTTP or HTTPS) must be allowed. + */ + @JsonProperty(value = "properties.isHttpsAllowed") + private Boolean isHttpsAllowed; + + /** + * Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent + * requests that contain query strings from being cached, or cache every + * request with a unique URL. Possible values include: 'IgnoreQueryString', + * 'BypassCaching', 'UseQueryString', 'NotSet'. + */ + @JsonProperty(value = "properties.queryStringCachingBehavior") + private QueryStringCachingBehavior queryStringCachingBehavior; + + /** + * Specifies what scenario the customer wants this CDN endpoint to optimize + * for, e.g. Download, Media services. With this information, CDN can apply + * scenario driven optimization. Possible values include: + * 'GeneralWebDelivery', 'GeneralMediaStreaming', + * 'VideoOnDemandMediaStreaming', 'LargeFileDownload', + * 'DynamicSiteAcceleration'. + */ + @JsonProperty(value = "properties.optimizationType") + private OptimizationType optimizationType; + + /** + * Path to a file hosted on the origin which helps accelerate delivery of + * the dynamic content and calculate the most optimal routes for the CDN. + * This is relative to the origin path. + */ + @JsonProperty(value = "properties.probePath") + private String probePath; + + /** + * List of rules defining the user's geo access within a CDN endpoint. Each + * geo filter defines an acess rule to a specified path or content, e.g. + * block APAC for path /pictures/. + */ + @JsonProperty(value = "properties.geoFilters") + private List geoFilters; + + /** + * A policy that specifies the delivery rules to be used for an endpoint. + */ + @JsonProperty(value = "properties.deliveryPolicy") + private EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy; + + /** + * The host name of the endpoint structured as {endpointName}.{DNSZone}, + * e.g. consoto.azureedge.net. + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The source of the content being delivered via CDN. + */ + @JsonProperty(value = "properties.origins", required = true) + private List origins; + + /** + * Resource status of the endpoint. Possible values include: 'Creating', + * 'Deleting', 'Running', 'Starting', 'Stopped', 'Stopping'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private EndpointResourceState resourceState; + + /** + * Provisioning status of the endpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get a directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value + */ + public String originPath() { + return this.originPath; + } + + /** + * Set a directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get list of content types on which compression applies. The value should be a valid MIME type. + * + * @return the contentTypesToCompress value + */ + public List contentTypesToCompress() { + return this.contentTypesToCompress; + } + + /** + * Set list of content types on which compression applies. The value should be a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withContentTypesToCompress(List contentTypesToCompress) { + this.contentTypesToCompress = contentTypesToCompress; + return this; + } + + /** + * Get indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value + */ + public Boolean isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withIsCompressionEnabled(Boolean isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Get indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value + */ + public Boolean isHttpAllowed() { + return this.isHttpAllowed; + } + + /** + * Set indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withIsHttpAllowed(Boolean isHttpAllowed) { + this.isHttpAllowed = isHttpAllowed; + return this; + } + + /** + * Get indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value + */ + public Boolean isHttpsAllowed() { + return this.isHttpsAllowed; + } + + /** + * Set indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withIsHttpsAllowed(Boolean isHttpsAllowed) { + this.isHttpsAllowed = isHttpsAllowed; + return this; + } + + /** + * Get defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'. + * + * @return the queryStringCachingBehavior value + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration'. + * + * @return the optimizationType value + */ + public OptimizationType optimizationType() { + return this.optimizationType; + } + + /** + * Set specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration'. + * + * @param optimizationType the optimizationType value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withOptimizationType(OptimizationType optimizationType) { + this.optimizationType = optimizationType; + return this; + } + + /** + * Get path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. + * + * @return the probePath value + */ + public String probePath() { + return this.probePath; + } + + /** + * Set path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. + * + * @param probePath the probePath value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + + /** + * Get list of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value + */ + public List geoFilters() { + return this.geoFilters; + } + + /** + * Set list of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withGeoFilters(List geoFilters) { + this.geoFilters = geoFilters; + return this; + } + + /** + * Get a policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.deliveryPolicy; + } + + /** + * Set a policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + this.deliveryPolicy = deliveryPolicy; + return this; + } + + /** + * Get the host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. consoto.azureedge.net. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the source of the content being delivered via CDN. + * + * @return the origins value + */ + public List origins() { + return this.origins; + } + + /** + * Set the source of the content being delivered via CDN. + * + * @param origins the origins value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get resource status of the endpoint. Possible values include: 'Creating', 'Deleting', 'Running', 'Starting', 'Stopped', 'Stopping'. + * + * @return the resourceState value + */ + public EndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get provisioning status of the endpoint. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointsInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointsInner.java new file mode 100644 index 0000000000000..5be7c6d16dddf --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointsInner.java @@ -0,0 +1,2080 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.EndpointUpdateParameters; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.management.cdn.LoadParameters; +import com.microsoft.azure.management.cdn.PurgeParameters; +import com.microsoft.azure.management.cdn.ValidateCustomDomainInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +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.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Endpoints. + */ +public class EndpointsInner { + /** The Retrofit service to perform REST calls. */ + private EndpointsService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of EndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EndpointsInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(EndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Endpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface EndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints listByProfile" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints") + Observable> listByProfile(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner endpoint, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner endpoint, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointUpdateParameters endpointUpdateProperties, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointUpdateParameters endpointUpdateProperties, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints purgeContent" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge") + Observable> purgeContent(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PurgeParameters contentFilePaths, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginPurgeContent" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge") + Observable> beginPurgeContent(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PurgeParameters contentFilePaths, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints loadContent" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load") + Observable> loadContent(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LoadParameters contentFilePaths, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints beginLoadContent" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load") + Observable> beginLoadContent(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LoadParameters contentFilePaths, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints validateCustomDomain" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain") + Observable> validateCustomDomain(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ValidateCustomDomainInput customDomainProperties, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints listResourceUsage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage") + Observable> listResourceUsage(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints listByProfileNext" }) + @GET + Observable> listByProfileNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Endpoints listResourceUsageNext" }) + @GET + Observable> listResourceUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointInner> object if successful. + */ + public PagedList listByProfile(final String resourceGroupName, final String profileName) { + ServiceResponse> response = listByProfileSinglePageAsync(resourceGroupName, profileName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByProfileAsync(final String resourceGroupName, final String profileName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByProfileSinglePageAsync(resourceGroupName, profileName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointInner> object + */ + public Observable> listByProfileAsync(final String resourceGroupName, final String profileName) { + return listByProfileWithServiceResponseAsync(resourceGroupName, profileName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointInner> object + */ + public Observable>> listByProfileWithServiceResponseAsync(final String resourceGroupName, final String profileName) { + return listByProfileSinglePageAsync(resourceGroupName, profileName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists existing CDN endpoints. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByProfileSinglePageAsync(final String resourceGroupName, final String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByProfile(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByProfileDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner get(String resourceGroupName, String profileName, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().single().body(); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner create(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + return createWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpoint).toBlocking().last().body(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpoint), serviceCallback); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + return createWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpoint).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (endpoint == null) { + throw new IllegalArgumentException("Parameter endpoint is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(endpoint); + Observable> observable = service.create(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), endpoint, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner beginCreate(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpoint).toBlocking().single().body(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpoint), serviceCallback); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpoint).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint Endpoint properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (endpoint == null) { + throw new IllegalArgumentException("Parameter endpoint is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(endpoint); + return service.beginCreate(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), endpoint, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner update(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).toBlocking().last().body(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties), serviceCallback); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (endpointUpdateProperties == null) { + throw new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(endpointUpdateProperties); + Observable> observable = service.update(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), endpointUpdateProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner beginUpdate(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).toBlocking().single().body(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties), serviceCallback); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, EndpointUpdateParameters endpointUpdateProperties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (endpointUpdateProperties == null) { + throw new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(endpointUpdateProperties); + return service.beginUpdate(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), endpointUpdateProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String profileName, String endpointName) { + deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().last().body(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String profileName, String endpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().single().body(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String profileName, String endpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner start(String resourceGroupName, String profileName, String endpointName) { + return startWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().last().body(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String profileName, String endpointName) { + return startWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner beginStart(String resourceGroupName, String profileName, String endpointName) { + return beginStartWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().single().body(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable beginStartAsync(String resourceGroupName, String profileName, String endpointName) { + return beginStartWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner stop(String resourceGroupName, String profileName, String endpointName) { + return stopWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().last().body(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String profileName, String endpointName) { + return stopWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner beginStop(String resourceGroupName, String profileName, String endpointName) { + return beginStopWithServiceResponseAsync(resourceGroupName, profileName, endpointName).toBlocking().single().body(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String profileName, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, profileName, endpointName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable beginStopAsync(String resourceGroupName, String profileName, String endpointName) { + return beginStopWithServiceResponseAsync(resourceGroupName, profileName, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void purgeContent(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + purgeContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).toBlocking().last().body(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture purgeContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths), serviceCallback); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable purgeContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + return purgeContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> purgeContentWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (contentPaths == null) { + throw new IllegalArgumentException("Parameter contentPaths is required and cannot be null."); + } + Validator.validate(contentPaths); + PurgeParameters contentFilePaths = new PurgeParameters(); + contentFilePaths.withContentPaths(contentPaths); + Observable> observable = service.purgeContent(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), contentFilePaths, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPurgeContent(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + beginPurgeContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).toBlocking().single().body(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPurgeContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPurgeContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths), serviceCallback); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginPurgeContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + return beginPurgeContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be purged. Can describe a file path or a wild card directory. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginPurgeContentWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (contentPaths == null) { + throw new IllegalArgumentException("Parameter contentPaths is required and cannot be null."); + } + Validator.validate(contentPaths); + PurgeParameters contentFilePaths = new PurgeParameters(); + contentFilePaths.withContentPaths(contentPaths); + return service.beginPurgeContent(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), contentFilePaths, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPurgeContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPurgeContentDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void loadContent(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + loadContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).toBlocking().last().body(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture loadContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(loadContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths), serviceCallback); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable loadContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + return loadContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> loadContentWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (contentPaths == null) { + throw new IllegalArgumentException("Parameter contentPaths is required and cannot be null."); + } + Validator.validate(contentPaths); + LoadParameters contentFilePaths = new LoadParameters(); + contentFilePaths.withContentPaths(contentPaths); + Observable> observable = service.loadContent(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), contentFilePaths, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginLoadContent(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + beginLoadContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).toBlocking().single().body(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginLoadContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginLoadContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths), serviceCallback); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginLoadContentAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + return beginLoadContentWithServiceResponseAsync(resourceGroupName, profileName, endpointName, contentPaths).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentPaths The path to the content to be loaded. Path should be a relative file URL of the origin. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginLoadContentWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, List contentPaths) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (contentPaths == null) { + throw new IllegalArgumentException("Parameter contentPaths is required and cannot be null."); + } + Validator.validate(contentPaths); + LoadParameters contentFilePaths = new LoadParameters(); + contentFilePaths.withContentPaths(contentPaths); + return service.beginLoadContent(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), contentFilePaths, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginLoadContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginLoadContentDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateCustomDomainOutputInner object if successful. + */ + public ValidateCustomDomainOutputInner validateCustomDomain(String resourceGroupName, String profileName, String endpointName, String hostName) { + return validateCustomDomainWithServiceResponseAsync(resourceGroupName, profileName, endpointName, hostName).toBlocking().single().body(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param hostName The host name of the custom domain. Must be a domain name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateCustomDomainAsync(String resourceGroupName, String profileName, String endpointName, String hostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateCustomDomainWithServiceResponseAsync(resourceGroupName, profileName, endpointName, hostName), serviceCallback); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateCustomDomainOutputInner object + */ + public Observable validateCustomDomainAsync(String resourceGroupName, String profileName, String endpointName, String hostName) { + return validateCustomDomainWithServiceResponseAsync(resourceGroupName, profileName, endpointName, hostName).map(new Func1, ValidateCustomDomainOutputInner>() { + @Override + public ValidateCustomDomainOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param hostName The host name of the custom domain. Must be a domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateCustomDomainOutputInner object + */ + public Observable> validateCustomDomainWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String hostName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (hostName == null) { + throw new IllegalArgumentException("Parameter hostName is required and cannot be null."); + } + ValidateCustomDomainInput customDomainProperties = new ValidateCustomDomainInput(); + customDomainProperties.withHostName(hostName); + return service.validateCustomDomain(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), customDomainProperties, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateCustomDomainDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateCustomDomainDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceUsageInner> object if successful. + */ + public PagedList listResourceUsage(final String resourceGroupName, final String profileName, final String endpointName) { + ServiceResponse> response = listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listResourceUsageAsync(final String resourceGroupName, final String profileName, final String endpointName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable> listResourceUsageAsync(final String resourceGroupName, final String profileName, final String endpointName) { + return listResourceUsageWithServiceResponseAsync(resourceGroupName, profileName, endpointName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable>> listResourceUsageWithServiceResponseAsync(final String resourceGroupName, final String profileName, final String endpointName) { + return listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group. + ServiceResponse> * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceUsageSinglePageAsync(final String resourceGroupName, final String profileName, final String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listResourceUsage(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceUsageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listResourceUsageDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists existing CDN endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointInner> object if successful. + */ + public PagedList listByProfileNext(final String nextPageLink) { + ServiceResponse> response = listByProfileNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists existing CDN endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByProfileNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByProfileNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists existing CDN endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointInner> object + */ + public Observable> listByProfileNextAsync(final String nextPageLink) { + return listByProfileNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists existing CDN endpoints. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointInner> object + */ + public Observable>> listByProfileNextWithServiceResponseAsync(final String nextPageLink) { + return listByProfileNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists existing CDN endpoints. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByProfileNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByProfileNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByProfileNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByProfileNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceUsageInner> object if successful. + */ + public PagedList listResourceUsageNext(final String nextPageLink) { + ServiceResponse> response = listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listResourceUsageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceUsageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable> listResourceUsageNextAsync(final String nextPageLink) { + return listResourceUsageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable>> listResourceUsageNextWithServiceResponseAsync(final String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceUsageNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listResourceUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceUsageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listResourceUsageNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationInner.java new file mode 100644 index 0000000000000..9fbb003689a82 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationInner.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.implementation; + +import com.microsoft.azure.management.cdn.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * CDN REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationsInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationsInner.java new file mode 100644 index 0000000000000..fc0f688fbcf08 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Operations list" }) + @GET("providers/Microsoft.Cdn/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available CDN REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginInner.java new file mode 100644 index 0000000000000..d1f95038e9407 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginInner.java @@ -0,0 +1,133 @@ +/** + * 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.microsoft.azure.management.cdn.OriginResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * CDN origin is the source of the content being delivered via CDN. When the + * edge nodes represented by an endpoint do not have the requested content + * cached, they attempt to fetch it from one or more of the configured origins. + */ +@JsonFlatten +public class OriginInner extends Resource { + /** + * 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; + + /** + * Resource status of the origin. Possible values include: 'Creating', + * 'Active', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private OriginResourceState resourceState; + + /** + * Provisioning status of the origin. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set the address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. + * + * @param hostName the hostName value to set + * @return the OriginInner object itself. + */ + public OriginInner withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get the value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set + * @return the OriginInner object itself. + */ + public OriginInner withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the value of the https port. Must be between 1 and 65535. + * + * @return the httpsPort value + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the value of the https port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set + * @return the OriginInner object itself. + */ + public OriginInner withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get resource status of the origin. Possible values include: 'Creating', 'Active', 'Deleting'. + * + * @return the resourceState value + */ + public OriginResourceState resourceState() { + return this.resourceState; + } + + /** + * Get provisioning status of the origin. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginsInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginsInner.java new file mode 100644 index 0000000000000..c1e81b9dc710e --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/OriginsInner.java @@ -0,0 +1,628 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.management.cdn.OriginUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Origins. + */ +public class OriginsInner { + /** The Retrofit service to perform REST calls. */ + private OriginsService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of OriginsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OriginsInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(OriginsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Origins to be + * used by Retrofit to perform actually REST calls. + */ + interface OriginsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Origins listByEndpoint" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins") + Observable> listByEndpoint(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Origins get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("originName") String originName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Origins update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("originName") String originName, @Path("subscriptionId") String subscriptionId, @Body OriginUpdateParameters originUpdateProperties, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Origins beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointName") String endpointName, @Path("originName") String originName, @Path("subscriptionId") String subscriptionId, @Body OriginUpdateParameters originUpdateProperties, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Origins listByEndpointNext" }) + @GET + Observable> listByEndpointNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OriginInner> object if successful. + */ + public PagedList listByEndpoint(final String resourceGroupName, final String profileName, final String endpointName) { + ServiceResponse> response = listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByEndpointAsync(final String resourceGroupName, final String profileName, final String endpointName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OriginInner> object + */ + public Observable> listByEndpointAsync(final String resourceGroupName, final String profileName, final String endpointName) { + return listByEndpointWithServiceResponseAsync(resourceGroupName, profileName, endpointName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OriginInner> object + */ + public Observable>> listByEndpointWithServiceResponseAsync(final String resourceGroupName, final String profileName, final String endpointName) { + return listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByEndpointNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the existing origins within an endpoint. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group. + ServiceResponse> * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OriginInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEndpointSinglePageAsync(final String resourceGroupName, final String profileName, final String endpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByEndpoint(resourceGroupName, profileName, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEndpointDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEndpointDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OriginInner object if successful. + */ + public OriginInner get(String resourceGroupName, String profileName, String endpointName, String originName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName).toBlocking().single().body(); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointName, String originName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName), serviceCallback); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OriginInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointName, String originName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName).map(new Func1, OriginInner>() { + @Override + public OriginInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OriginInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String originName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (originName == null) { + throw new IllegalArgumentException("Parameter originName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointName, originName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OriginInner object if successful. + */ + public OriginInner update(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).toBlocking().last().body(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties), serviceCallback); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).map(new Func1, OriginInner>() { + @Override + public OriginInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (originName == null) { + throw new IllegalArgumentException("Parameter originName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (originUpdateProperties == null) { + throw new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(originUpdateProperties); + Observable> observable = service.update(resourceGroupName, profileName, endpointName, originName, this.client.subscriptionId(), originUpdateProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OriginInner object if successful. + */ + public OriginInner beginUpdate(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).toBlocking().single().body(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties), serviceCallback); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OriginInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).map(new Func1, OriginInner>() { + @Override + public OriginInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OriginInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointName, String originName, OriginUpdateParameters originUpdateProperties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName is required and cannot be null."); + } + if (originName == null) { + throw new IllegalArgumentException("Parameter originName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (originUpdateProperties == null) { + throw new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(originUpdateProperties); + return service.beginUpdate(resourceGroupName, profileName, endpointName, originName, this.client.subscriptionId(), originUpdateProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OriginInner> object if successful. + */ + public PagedList listByEndpointNext(final String nextPageLink) { + ServiceResponse> response = listByEndpointNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByEndpointNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEndpointNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OriginInner> object + */ + public Observable> listByEndpointNextAsync(final String nextPageLink) { + return listByEndpointNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OriginInner> object + */ + public Observable>> listByEndpointNextWithServiceResponseAsync(final String nextPageLink) { + return listByEndpointNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByEndpointNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the existing origins within an endpoint. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OriginInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEndpointNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByEndpointNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEndpointNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEndpointNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/PageImpl.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/PageImpl.java new file mode 100644 index 0000000000000..4480804ada890 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfileInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfileInner.java new file mode 100644 index 0000000000000..ad99899079aae --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfileInner.java @@ -0,0 +1,81 @@ +/** + * 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.microsoft.azure.management.cdn.Sku; +import com.microsoft.azure.management.cdn.ProfileResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * CDN profile is a logical grouping of endpoints that share the same settings, + * such as CDN provider and pricing tier. + */ +@JsonFlatten +public class ProfileInner extends Resource { + /** + * The pricing tier (defines a CDN provider, feature list and rate) of the + * CDN profile. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * Resource status of the profile. Possible values include: 'Creating', + * 'Active', 'Deleting', 'Disabled'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ProfileResourceState resourceState; + + /** + * Provisioning status of the profile. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. + * + * @param sku the sku value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get resource status of the profile. Possible values include: 'Creating', 'Active', 'Deleting', 'Disabled'. + * + * @return the resourceState value + */ + public ProfileResourceState resourceState() { + return this.resourceState; + } + + /** + * Get provisioning status of the profile. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfilesInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfilesInner.java new file mode 100644 index 0000000000000..ce1cafc05ee4e --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProfilesInner.java @@ -0,0 +1,1719 @@ +/** + * 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.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.management.cdn.ProfileUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Profiles. + */ +public class ProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ProfilesService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of ProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProfilesInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(ProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Profiles to be + * used by Retrofit to perform actually REST calls. + */ + interface ProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner profile, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner profile, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ProfileUpdateParameters profileUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ProfileUpdateParameters profileUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles generateSsoUri" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri") + Observable> generateSsoUri(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listSupportedOptimizationTypes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes") + Observable> listSupportedOptimizationTypes(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listResourceUsage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage") + Observable> listResourceUsage(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.Profiles listResourceUsageNext" }) + @GET + Observable> listResourceUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProfileInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProfileInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets a CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets a CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile) { + return createWithServiceResponseAsync(resourceGroupName, profileName, profile).toBlocking().last().body(); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String profileName, ProfileInner profile, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, profileName, profile), serviceCallback); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String profileName, ProfileInner profile) { + return createWithServiceResponseAsync(resourceGroupName, profileName, profile).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner profile) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (profile == null) { + throw new IllegalArgumentException("Parameter profile is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(profile); + Observable> observable = service.create(resourceGroupName, profileName, this.client.subscriptionId(), profile, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner beginCreate(String resourceGroupName, String profileName, ProfileInner profile) { + return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, profile).toBlocking().single().body(); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String profileName, ProfileInner profile, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, profileName, profile), serviceCallback); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String profileName, ProfileInner profile) { + return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, profile).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new CDN profile with a profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner profile) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (profile == null) { + throw new IllegalArgumentException("Parameter profile is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(profile); + return service.beginCreate(resourceGroupName, profileName, this.client.subscriptionId(), profile, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner update(String resourceGroupName, String profileName) { + return updateWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().last().body(); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String profileName) { + return updateWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ProfileUpdateParameters profileUpdateParameters = new ProfileUpdateParameters(); + profileUpdateParameters.withTags(null); + Observable> observable = service.update(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), profileUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner update(String resourceGroupName, String profileName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, tags).toBlocking().last().body(); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, tags), serviceCallback); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String profileName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, tags).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ProfileUpdateParameters profileUpdateParameters = new ProfileUpdateParameters(); + profileUpdateParameters.withTags(tags); + Observable> observable = service.update(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), profileUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner beginUpdate(String resourceGroupName, String profileName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String profileName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ProfileUpdateParameters profileUpdateParameters = new ProfileUpdateParameters(); + profileUpdateParameters.withTags(null); + return service.beginUpdate(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), profileUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner beginUpdate(String resourceGroupName, String profileName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, tags).toBlocking().single().body(); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String profileName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, tags), serviceCallback); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String profileName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, tags).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param tags Profile tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ProfileUpdateParameters profileUpdateParameters = new ProfileUpdateParameters(); + profileUpdateParameters.withTags(tags); + return service.beginUpdate(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), profileUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String profileName) { + deleteWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().last().body(); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String profileName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String profileName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SsoUriInner object if successful. + */ + public SsoUriInner generateSsoUri(String resourceGroupName, String profileName) { + return generateSsoUriWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateSsoUriAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateSsoUriWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SsoUriInner object + */ + public Observable generateSsoUriAsync(String resourceGroupName, String profileName) { + return generateSsoUriWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, SsoUriInner>() { + @Override + public SsoUriInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SsoUriInner object + */ + public Observable> generateSsoUriWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.generateSsoUri(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = generateSsoUriDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse generateSsoUriDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SupportedOptimizationTypesListResultInner object if successful. + */ + public SupportedOptimizationTypesListResultInner listSupportedOptimizationTypes(String resourceGroupName, String profileName) { + return listSupportedOptimizationTypesWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSupportedOptimizationTypesAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSupportedOptimizationTypesWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportedOptimizationTypesListResultInner object + */ + public Observable listSupportedOptimizationTypesAsync(String resourceGroupName, String profileName) { + return listSupportedOptimizationTypesWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, SupportedOptimizationTypesListResultInner>() { + @Override + public SupportedOptimizationTypesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportedOptimizationTypesListResultInner object + */ + public Observable> listSupportedOptimizationTypesWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSupportedOptimizationTypes(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSupportedOptimizationTypesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSupportedOptimizationTypesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceUsageInner> object if successful. + */ + public PagedList listResourceUsage(final String resourceGroupName, final String profileName) { + ServiceResponse> response = listResourceUsageSinglePageAsync(resourceGroupName, profileName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listResourceUsageAsync(final String resourceGroupName, final String profileName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceUsageSinglePageAsync(resourceGroupName, profileName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable> listResourceUsageAsync(final String resourceGroupName, final String profileName) { + return listResourceUsageWithServiceResponseAsync(resourceGroupName, profileName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable>> listResourceUsageWithServiceResponseAsync(final String resourceGroupName, final String profileName) { + return listResourceUsageSinglePageAsync(resourceGroupName, profileName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceUsageSinglePageAsync(final String resourceGroupName, final String profileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listResourceUsage(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceUsageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listResourceUsageDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProfileInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the CDN profiles within an Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProfileInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProfileInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the CDN profiles within a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceUsageInner> object if successful. + */ + public PagedList listResourceUsageNext(final String nextPageLink) { + ServiceResponse> response = listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listResourceUsageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceUsageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable> listResourceUsageNextAsync(final String nextPageLink) { + return listResourceUsageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable>> listResourceUsageNextWithServiceResponseAsync(final String nextPageLink) { + return listResourceUsageNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN profile. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceUsageNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listResourceUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceUsageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listResourceUsageNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsageInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsageInner.java new file mode 100644 index 0000000000000..4db513d3cde80 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsageInner.java @@ -0,0 +1,77 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of check resource usage API. + */ +public class ResourceUsageInner { + /** + * Resource type for which the usage is provided. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * Unit of the usage. e.g. Count. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Actual value of usage on the specified resource type. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * Quota of the specified resource type. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * Get resource type for which the usage is provided. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get unit of the usage. e.g. Count. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get actual value of usage on the specified resource type. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get quota of the specified resource type. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsagesInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsagesInner.java new file mode 100644 index 0000000000000..a0d8a087a9dc2 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ResourceUsagesInner.java @@ -0,0 +1,288 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.cdn.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ResourceUsages. + */ +public class ResourceUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ResourceUsagesService service; + /** The service client containing this operation class. */ + private CdnManagementClientImpl client; + + /** + * Initializes an instance of ResourceUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourceUsagesInner(Retrofit retrofit, CdnManagementClientImpl client) { + this.service = retrofit.create(ResourceUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourceUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourceUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.ResourceUsages list" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.ResourceUsages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceUsageInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceUsageInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceUsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SsoUriInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SsoUriInner.java new file mode 100644 index 0000000000000..b35899fdea80f --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SsoUriInner.java @@ -0,0 +1,32 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URI required to login to the supplemental portal from the Azure portal. + */ +public class SsoUriInner { + /** + * The URI used to login to the supplemental portal. + */ + @JsonProperty(value = "ssoUriValue", access = JsonProperty.Access.WRITE_ONLY) + private String ssoUriValue; + + /** + * Get the URI used to login to the supplemental portal. + * + * @return the ssoUriValue value + */ + public String ssoUriValue() { + return this.ssoUriValue; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SupportedOptimizationTypesListResultInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SupportedOptimizationTypesListResultInner.java new file mode 100644 index 0000000000000..f21b8e9ae4321 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/SupportedOptimizationTypesListResultInner.java @@ -0,0 +1,34 @@ +/** + * 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 java.util.List; +import com.microsoft.azure.management.cdn.OptimizationType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of the GetSupportedOptimizationTypes API. + */ +public class SupportedOptimizationTypesListResultInner { + /** + * Supported optimization types for a profile. + */ + @JsonProperty(value = "supportedOptimizationTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedOptimizationTypes; + + /** + * Get supported optimization types for a profile. + * + * @return the supportedOptimizationTypes value + */ + public List supportedOptimizationTypes() { + return this.supportedOptimizationTypes; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateCustomDomainOutputInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateCustomDomainOutputInner.java new file mode 100644 index 0000000000000..6ffc0ffc12f6e --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateCustomDomainOutputInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of custom domain validation. + */ +public class ValidateCustomDomainOutputInner { + /** + * Indicates whether the custom domain is valid or not. + */ + @JsonProperty(value = "customDomainValidated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean customDomainValidated; + + /** + * The reason why the custom domain is not valid. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * Error message describing why the custom domain is not valid. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get indicates whether the custom domain is valid or not. + * + * @return the customDomainValidated value + */ + public Boolean customDomainValidated() { + return this.customDomainValidated; + } + + /** + * Get the reason why the custom domain is not valid. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get error message describing why the custom domain is not valid. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateProbeOutputInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateProbeOutputInner.java new file mode 100644 index 0000000000000..70a79dcd33515 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ValidateProbeOutputInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of the validate probe API. + */ +public class ValidateProbeOutputInner { + /** + * Indicates whether the probe URL is accepted or not. + */ + @JsonProperty(value = "isValid", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isValid; + + /** + * Specifies the error code when the probe url is not accepted. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /** + * The detailed error message describing why the probe URL is not accepted. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get indicates whether the probe URL is accepted or not. + * + * @return the isValid value + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Get specifies the error code when the probe url is not accepted. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the detailed error message describing why the probe URL is not accepted. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/package-info.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/package-info.java new file mode 100644 index 0000000000000..a827b0d09c17e --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for CdnManagementClient. + * Use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must make sure that requests made to these resources are secure. + */ +package com.microsoft.azure.management.cdn.implementation; diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/package-info.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/package-info.java new file mode 100644 index 0000000000000..cacf51cbc161b --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for CdnManagementClient. + * Use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must make sure that requests made to these resources are secure. + */ +package com.microsoft.azure.management.cdn;