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 00000000000..ee214dad826 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CacheExpirationActionParameters.java @@ -0,0 +1,131 @@ +/** + * 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. + */ + 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 the cacheBehavior value. + * + * @return the cacheBehavior value + */ + public String cacheBehavior() { + return this.cacheBehavior; + } + + /** + * Set the cacheBehavior value. + * + * @param cacheBehavior the cacheBehavior value to set + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheBehavior(String cacheBehavior) { + this.cacheBehavior = cacheBehavior; + return this; + } + + /** + * Get the cacheType value. + * + * @return the cacheType value + */ + public String cacheType() { + return this.cacheType; + } + + /** + * Set the cacheType value. + * + * @param cacheType the cacheType value to set + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheType(String cacheType) { + this.cacheType = cacheType; + return this; + } + + /** + * Get the cacheDuration value. + * + * @return the cacheDuration value + */ + public String cacheDuration() { + return this.cacheDuration; + } + + /** + * Set the cacheDuration value. + * + * @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/CustomDomainResourceState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CustomDomainResourceState.java index 9049d8c75ca..fc00f10f62f 100644 --- 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 @@ -8,55 +8,37 @@ package com.microsoft.azure.management.cdn; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for CustomDomainResourceState. */ -public final class CustomDomainResourceState { +public final class CustomDomainResourceState extends ExpandableStringEnum { /** Static value Creating for CustomDomainResourceState. */ - public static final CustomDomainResourceState CREATING = new CustomDomainResourceState("Creating"); + public static final CustomDomainResourceState CREATING = fromString("Creating"); /** Static value Active for CustomDomainResourceState. */ - public static final CustomDomainResourceState ACTIVE = new CustomDomainResourceState("Active"); + public static final CustomDomainResourceState ACTIVE = fromString("Active"); /** Static value Deleting for CustomDomainResourceState. */ - public static final CustomDomainResourceState DELETING = new CustomDomainResourceState("Deleting"); - - private String value; + public static final CustomDomainResourceState DELETING = fromString("Deleting"); /** - * Creates a custom value for CustomDomainResourceState. - * @param value the custom value + * Creates or finds a CustomDomainResourceState from its string representation. + * @param name a name to look for + * @return the corresponding CustomDomainResourceState */ - public CustomDomainResourceState(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static CustomDomainResourceState fromString(String name) { + return fromString(name, CustomDomainResourceState.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof CustomDomainResourceState)) { - return false; - } - if (obj == this) { - return true; - } - CustomDomainResourceState rhs = (CustomDomainResourceState) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @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 index 3edea8af8ee..d61cb4fca09 100644 --- 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 @@ -8,61 +8,43 @@ package com.microsoft.azure.management.cdn; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for CustomHttpsProvisioningState. */ -public final class CustomHttpsProvisioningState { +public final class CustomHttpsProvisioningState extends ExpandableStringEnum { /** Static value Enabling for CustomHttpsProvisioningState. */ - public static final CustomHttpsProvisioningState ENABLING = new CustomHttpsProvisioningState("Enabling"); + public static final CustomHttpsProvisioningState ENABLING = fromString("Enabling"); /** Static value Enabled for CustomHttpsProvisioningState. */ - public static final CustomHttpsProvisioningState ENABLED = new CustomHttpsProvisioningState("Enabled"); + public static final CustomHttpsProvisioningState ENABLED = fromString("Enabled"); /** Static value Disabling for CustomHttpsProvisioningState. */ - public static final CustomHttpsProvisioningState DISABLING = new CustomHttpsProvisioningState("Disabling"); + public static final CustomHttpsProvisioningState DISABLING = fromString("Disabling"); /** Static value Disabled for CustomHttpsProvisioningState. */ - public static final CustomHttpsProvisioningState DISABLED = new CustomHttpsProvisioningState("Disabled"); + public static final CustomHttpsProvisioningState DISABLED = fromString("Disabled"); /** Static value Failed for CustomHttpsProvisioningState. */ - public static final CustomHttpsProvisioningState FAILED = new CustomHttpsProvisioningState("Failed"); - - private String value; + public static final CustomHttpsProvisioningState FAILED = fromString("Failed"); /** - * Creates a custom value for CustomHttpsProvisioningState. - * @param value the custom value + * Creates or finds a CustomHttpsProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding CustomHttpsProvisioningState */ - public CustomHttpsProvisioningState(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static CustomHttpsProvisioningState fromString(String name) { + return fromString(name, CustomHttpsProvisioningState.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof CustomHttpsProvisioningState)) { - return false; - } - if (obj == this) { - return true; - } - CustomHttpsProvisioningState rhs = (CustomHttpsProvisioningState) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @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 00000000000..2adc5e15ade --- /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 index a7a6c8b51ab..34025ee030e 100644 --- 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 @@ -12,7 +12,7 @@ import com.microsoft.rest.serializer.JsonFlatten; /** - * Origin to be added when creating a CDN endpoint. + * The main origin of CDN content which is added when creating a CDN endpoint. */ @JsonFlatten public class DeepCreatedOrigin { @@ -23,7 +23,7 @@ public class DeepCreatedOrigin { private String name; /** - * The address of the origin. It can be a domain names, IPv4 address, or + * The address of the origin. It can be a domain name, IPv4 address, or * IPv6 address. */ @JsonProperty(value = "properties.hostName", required = true) 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 00000000000..8b69b7603b5 --- /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 value. + * + * @return the order value + */ + public int order() { + return this.order; + } + + /** + * Set the order value. + * + * @param order the order value to set + * @return the DeliveryRule object itself. + */ + public DeliveryRule withOrder(int order) { + this.order = order; + return this; + } + + /** + * Get the actions value. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions value. + * + * @param actions the actions value to set + * @return the DeliveryRule object itself. + */ + public DeliveryRule withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the conditions value. + * + * @return the conditions value + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions value. + * + * @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 00000000000..6b834df10c0 --- /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 00000000000..312fb8f3c23 --- /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 the parameters value. + * + * @return the parameters value + */ + public CacheExpirationActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @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 00000000000..d65e8b4eee9 --- /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 00000000000..51207eed4ba --- /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 the parameters value. + * + * @return the parameters value + */ + public UrlFileExtensionConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @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 00000000000..c19b21d24af --- /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 the parameters value. + * + * @return the parameters value + */ + public UrlPathConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @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 00000000000..9cdfae4049a --- /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 the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules value. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules value. + * + * @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 index ba1e6561519..ee265988750 100644 --- 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 @@ -8,64 +8,46 @@ package com.microsoft.azure.management.cdn; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for EndpointResourceState. */ -public final class EndpointResourceState { +public final class EndpointResourceState extends ExpandableStringEnum { /** Static value Creating for EndpointResourceState. */ - public static final EndpointResourceState CREATING = new EndpointResourceState("Creating"); + public static final EndpointResourceState CREATING = fromString("Creating"); /** Static value Deleting for EndpointResourceState. */ - public static final EndpointResourceState DELETING = new EndpointResourceState("Deleting"); + public static final EndpointResourceState DELETING = fromString("Deleting"); /** Static value Running for EndpointResourceState. */ - public static final EndpointResourceState RUNNING = new EndpointResourceState("Running"); + public static final EndpointResourceState RUNNING = fromString("Running"); /** Static value Starting for EndpointResourceState. */ - public static final EndpointResourceState STARTING = new EndpointResourceState("Starting"); + public static final EndpointResourceState STARTING = fromString("Starting"); /** Static value Stopped for EndpointResourceState. */ - public static final EndpointResourceState STOPPED = new EndpointResourceState("Stopped"); + public static final EndpointResourceState STOPPED = fromString("Stopped"); /** Static value Stopping for EndpointResourceState. */ - public static final EndpointResourceState STOPPING = new EndpointResourceState("Stopping"); - - private String value; + public static final EndpointResourceState STOPPING = fromString("Stopping"); /** - * Creates a custom value for EndpointResourceState. - * @param value the custom value + * Creates or finds a EndpointResourceState from its string representation. + * @param name a name to look for + * @return the corresponding EndpointResourceState */ - public EndpointResourceState(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static EndpointResourceState fromString(String name) { + return fromString(name, EndpointResourceState.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof EndpointResourceState)) { - return false; - } - if (obj == this) { - return true; - } - EndpointResourceState rhs = (EndpointResourceState) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @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/ErrorResponse.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ErrorResponse.java index 1fa319c316a..958408f7d14 100644 --- 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 @@ -18,13 +18,13 @@ public class ErrorResponse { /** * Error code. */ - @JsonProperty(value = "code") + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /** * Error message indicating why the operation failed. */ - @JsonProperty(value = "message") + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** @@ -36,17 +36,6 @@ public String code() { return this.code; } - /** - * Set the code value. - * - * @param code the code value to set - * @return the ErrorResponse object itself. - */ - public ErrorResponse withCode(String code) { - this.code = code; - return this; - } - /** * Get the message value. * @@ -56,15 +45,4 @@ public String message() { return this.message; } - /** - * Set the message value. - * - * @param message the message value to set - * @return the ErrorResponse object itself. - */ - public ErrorResponse withMessage(String message) { - this.message = message; - return this; - } - } diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/GeoFilter.java index 8821603125e..41d94259bda 100644 --- 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 @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Rules defining user geo access within a CDN endpoint. + * Rules defining user's geo access within a CDN endpoint. */ public class GeoFilter { /** 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 index 2178e86a16a..ff586169a34 100644 --- 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 @@ -17,19 +17,19 @@ public class OperationDisplay { /** * Service provider: Microsoft.Cdn. */ - @JsonProperty(value = "provider") + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /** * Resource on which the operation is performed: Profile, endpoint, etc. */ - @JsonProperty(value = "resource") + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /** * Operation type: Read, write, delete, etc. */ - @JsonProperty(value = "operation") + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /** @@ -41,17 +41,6 @@ public String provider() { return this.provider; } - /** - * Set the provider value. - * - * @param provider the provider value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - /** * Get the resource value. * @@ -61,17 +50,6 @@ public String resource() { return this.resource; } - /** - * Set the resource value. - * - * @param resource the resource value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - /** * Get the operation value. * @@ -81,15 +59,4 @@ public String operation() { return this.operation; } - /** - * Set the operation value. - * - * @param operation the operation value to set - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - } diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OptimizationType.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/OptimizationType.java new file mode 100644 index 00000000000..6b93492362e --- /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 index 97b077d46f5..dba08f94695 100644 --- 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 @@ -8,55 +8,37 @@ package com.microsoft.azure.management.cdn; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for OriginResourceState. */ -public final class OriginResourceState { +public final class OriginResourceState extends ExpandableStringEnum { /** Static value Creating for OriginResourceState. */ - public static final OriginResourceState CREATING = new OriginResourceState("Creating"); + public static final OriginResourceState CREATING = fromString("Creating"); /** Static value Active for OriginResourceState. */ - public static final OriginResourceState ACTIVE = new OriginResourceState("Active"); + public static final OriginResourceState ACTIVE = fromString("Active"); /** Static value Deleting for OriginResourceState. */ - public static final OriginResourceState DELETING = new OriginResourceState("Deleting"); - - private String value; + public static final OriginResourceState DELETING = fromString("Deleting"); /** - * Creates a custom value for OriginResourceState. - * @param value the custom value + * Creates or finds a OriginResourceState from its string representation. + * @param name a name to look for + * @return the corresponding OriginResourceState */ - public OriginResourceState(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static OriginResourceState fromString(String name) { + return fromString(name, OriginResourceState.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof OriginResourceState)) { - return false; - } - if (obj == this) { - return true; - } - OriginResourceState rhs = (OriginResourceState) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @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/ProfileResourceState.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ProfileResourceState.java index 8c8bb0298a5..f14955f7b83 100644 --- 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 @@ -8,58 +8,40 @@ package com.microsoft.azure.management.cdn; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for ProfileResourceState. */ -public final class ProfileResourceState { +public final class ProfileResourceState extends ExpandableStringEnum { /** Static value Creating for ProfileResourceState. */ - public static final ProfileResourceState CREATING = new ProfileResourceState("Creating"); + public static final ProfileResourceState CREATING = fromString("Creating"); /** Static value Active for ProfileResourceState. */ - public static final ProfileResourceState ACTIVE = new ProfileResourceState("Active"); + public static final ProfileResourceState ACTIVE = fromString("Active"); /** Static value Deleting for ProfileResourceState. */ - public static final ProfileResourceState DELETING = new ProfileResourceState("Deleting"); + public static final ProfileResourceState DELETING = fromString("Deleting"); /** Static value Disabled for ProfileResourceState. */ - public static final ProfileResourceState DISABLED = new ProfileResourceState("Disabled"); - - private String value; + public static final ProfileResourceState DISABLED = fromString("Disabled"); /** - * Creates a custom value for ProfileResourceState. - * @param value the custom value + * Creates or finds a ProfileResourceState from its string representation. + * @param name a name to look for + * @return the corresponding ProfileResourceState */ - public ProfileResourceState(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static ProfileResourceState fromString(String name) { + return fromString(name, ProfileResourceState.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ProfileResourceState)) { - return false; - } - if (obj == this) { - return true; - } - ProfileResourceState rhs = (ProfileResourceState) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @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 index 1dfab96a07e..6d309208ce2 100644 --- 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 @@ -18,7 +18,7 @@ public class ProfileUpdateParameters { /** * Profile tags. */ - @JsonProperty(value = "tags", required = true) + @JsonProperty(value = "tags") private Map tags; /** 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 index d4203e2ee44..54f91c5506a 100644 --- 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 @@ -8,61 +8,43 @@ package com.microsoft.azure.management.cdn; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for SkuName. */ -public final class SkuName { +public final class SkuName extends ExpandableStringEnum { /** Static value Standard_Verizon for SkuName. */ - public static final SkuName STANDARD_VERIZON = new SkuName("Standard_Verizon"); + public static final SkuName STANDARD_VERIZON = fromString("Standard_Verizon"); /** Static value Premium_Verizon for SkuName. */ - public static final SkuName PREMIUM_VERIZON = new SkuName("Premium_Verizon"); + public static final SkuName PREMIUM_VERIZON = fromString("Premium_Verizon"); /** Static value Custom_Verizon for SkuName. */ - public static final SkuName CUSTOM_VERIZON = new SkuName("Custom_Verizon"); + public static final SkuName CUSTOM_VERIZON = fromString("Custom_Verizon"); /** Static value Standard_Akamai for SkuName. */ - public static final SkuName STANDARD_AKAMAI = new SkuName("Standard_Akamai"); + public static final SkuName STANDARD_AKAMAI = fromString("Standard_Akamai"); /** Static value Standard_ChinaCdn for SkuName. */ - public static final SkuName STANDARD_CHINA_CDN = new SkuName("Standard_ChinaCdn"); - - private String value; + public static final SkuName STANDARD_CHINA_CDN = fromString("Standard_ChinaCdn"); /** - * Creates a custom value for SkuName. - * @param value the custom value + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName */ - public SkuName(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof SkuName)) { - return false; - } - if (obj == this) { - return true; - } - SkuName rhs = (SkuName) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @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 00000000000..565fc665722 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlFileExtensionConditionParameters.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 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. + */ + 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 the extensions value. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions value. + * + * @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 00000000000..d04f5b646a0 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/UrlPathConditionParameters.java @@ -0,0 +1,103 @@ +/** + * 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. + */ + 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 the path value. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path value. + * + * @param path the path value to set + * @return the UrlPathConditionParameters object itself. + */ + public UrlPathConditionParameters withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the matchType value. + * + * @return the matchType value + */ + public String matchType() { + return this.matchType; + } + + /** + * Set the matchType value. + * + * @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/ValidateProbeInput.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/ValidateProbeInput.java new file mode 100644 index 00000000000..bd35b63d829 --- /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 probeURL value. + * + * @return the probeURL value + */ + public String probeURL() { + return this.probeURL; + } + + /** + * Set the probeURL value. + * + * @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 index 2dbcf9c5105..43af20dc343 100755 --- 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 @@ -11,28 +11,22 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.cdn.CheckNameAvailabilityInput; import com.microsoft.azure.management.cdn.ErrorResponseException; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; +import com.microsoft.azure.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 java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; -import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.Query; -import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -77,11 +71,11 @@ public CdnManagementClientImpl withSubscriptionId(String subscriptionId) { return this; } - /** Version of the API to be used with the client request. Current version is 2016-10-02. */ + /** 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 2016-10-02. + * Gets Version of the API to be used with the client request. Current version is 2017-04-02. * * @return the apiVersion value. */ @@ -210,6 +204,32 @@ 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. */ @@ -254,7 +274,7 @@ public CdnManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2016-10-02"; + this.apiVersion = "2017-10-12"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -262,6 +282,8 @@ protected void initialize() { 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(); @@ -274,7 +296,7 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "CdnManagementClient", "2016-10-02"); + return String.format("%s (%s, %s)", super.userAgent(), "CdnManagementClient", "2017-10-12"); } private void initializeService() { @@ -290,21 +312,13 @@ interface CdnManagementClientService { @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 listResourceUsage" }) - @POST("subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage") - Observable> listResourceUsage(@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.CdnManagementClient listOperations" }) - @GET("providers/Microsoft.Cdn/operations") - Observable> listOperations(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.CdnManagementClient listResourceUsageNext" }) - @GET - Observable> listResourceUsageNext(@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.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 listOperationsNext" }) - @GET - Observable> listOperationsNext(@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.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); } @@ -387,202 +401,72 @@ private ServiceResponse checkNameAvailabilityD } /** - * Check the quota and actual usage of the CDN profiles under the given subscription. + * 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 PagedList<ResourceUsageInner> object if successful. + * @return the CheckNameAvailabilityOutputInner object if successful. */ - public PagedList listResourceUsage() { - ServiceResponse> response = listResourceUsageSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public CheckNameAvailabilityOutputInner checkNameAvailabilityWithSubscription(String name) { + return checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(name).toBlocking().single().body(); } /** - * Check the quota and actual usage of the CDN profiles under the given subscription. + * 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> listResourceUsageAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listResourceUsageSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listResourceUsageNextSinglePageAsync(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> listResourceUsageAsync() { - return listResourceUsageWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public ServiceFuture checkNameAvailabilityWithSubscriptionAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(name), serviceCallback); } /** - * Check the quota and actual usage of the CDN profiles under the given subscription. + * 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 PagedList<ResourceUsageInner> object + * @return the observable to the CheckNameAvailabilityOutputInner object */ - public Observable>> listResourceUsageWithServiceResponseAsync() { - return listResourceUsageSinglePageAsync() - .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)); - } - }); + public Observable checkNameAvailabilityWithSubscriptionAsync(String name) { + return checkNameAvailabilityWithSubscriptionWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityOutputInner>() { + @Override + public CheckNameAvailabilityOutputInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Check the quota and actual usage of the CDN profiles under the given subscription. + * 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 PagedList<ResourceUsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the CheckNameAvailabilityOutputInner object */ - public Observable>> listResourceUsageSinglePageAsync() { + 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."); } - return service.listResourceUsage(this.subscriptionId(), this.apiVersion(), this.acceptLanguage(), this.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.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - - /** - * 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 listOperations() { - ServiceResponse> response = listOperationsSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listOperationsNextSinglePageAsync(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> listOperationsAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listOperationsSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listOperationsNextSinglePageAsync(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> listOperationsAsync() { - return listOperationsWithServiceResponseAsync() - .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>> listOperationsWithServiceResponseAsync() { - return listOperationsSinglePageAsync() - .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(listOperationsNextWithServiceResponseAsync(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>> listOperationsSinglePageAsync() { - 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."); } - return service.listOperations(this.apiVersion(), this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>>() { + 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) { + public Observable> call(Response response) { try { - ServiceResponse> result = listOperationsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = checkNameAvailabilityWithSubscriptionDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -590,221 +474,80 @@ public Observable>> call(Response> listOperationsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + 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 the quota and actual usage of the CDN profiles under the given subscription. + * 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 nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<ResourceUsageInner> object if successful. + * @return the ValidateProbeOutputInner 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(); - } - }; + public ValidateProbeOutputInner validateProbe(String probeURL) { + return validateProbeWithServiceResponseAsync(probeURL).toBlocking().single().body(); } /** - * Check the quota and actual usage of the CDN profiles under the given subscription. + * 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 nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> 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); - } - - /** - * 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> listResourceUsageNextAsync(final String nextPageLink) { - return listResourceUsageNextWithServiceResponseAsync(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>> 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)); - } - }); - } - - /** - * 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>> 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.acceptLanguage(), this.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.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); + public ServiceFuture validateProbeAsync(String probeURL, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateProbeWithServiceResponseAsync(probeURL), serviceCallback); } /** - * Lists all of the available CDN REST API operations. + * 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 nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<OperationInner> object if successful. + * @return the observable to the ValidateProbeOutputInner object */ - public PagedList listOperationsNext(final String nextPageLink) { - ServiceResponse> response = listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public Observable validateProbeAsync(String probeURL) { + return validateProbeWithServiceResponseAsync(probeURL).map(new Func1, ValidateProbeOutputInner>() { @Override - public Page nextPage(String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public ValidateProbeOutputInner 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. - * @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> listOperationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listOperationsNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Lists all of the available CDN REST API operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable> listOperationsNextAsync(final String nextPageLink) { - return listOperationsNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.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>> listOperationsNextWithServiceResponseAsync(final String nextPageLink) { - return listOperationsNextSinglePageAsync(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(listOperationsNextWithServiceResponseAsync(nextPageLink)); - } - }); + }); } /** - * Lists all of the available CDN REST API operations. + * 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. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param probeURL The probe URL to validate. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the ValidateProbeOutputInner object */ - public Observable>> listOperationsNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + 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."); } - String nextUrl = String.format("%s", nextPageLink); - return service.listOperationsNext(nextUrl, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>>() { + 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) { + public Observable> call(Response response) { try { - ServiceResponse> result = listOperationsNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = validateProbeDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -812,9 +555,9 @@ public Observable>> call(Response> listOperationsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + 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 index a19691899ec..20edf8094a2 100644 --- 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 @@ -17,19 +17,19 @@ public class CheckNameAvailabilityOutputInner { /** * Indicates whether the name is available. */ - @JsonProperty(value = "nameAvailable") + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /** * The reason why the name is not available. */ - @JsonProperty(value = "reason") + @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") + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** @@ -41,17 +41,6 @@ public Boolean nameAvailable() { return this.nameAvailable; } - /** - * Set the nameAvailable value. - * - * @param nameAvailable the nameAvailable value to set - * @return the CheckNameAvailabilityOutputInner object itself. - */ - public CheckNameAvailabilityOutputInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - /** * Get the reason value. * @@ -61,17 +50,6 @@ public String reason() { return this.reason; } - /** - * Set the reason value. - * - * @param reason the reason value to set - * @return the CheckNameAvailabilityOutputInner object itself. - */ - public CheckNameAvailabilityOutputInner withReason(String reason) { - this.reason = reason; - return this; - } - /** * Get the message value. * @@ -81,15 +59,4 @@ public String message() { return this.message; } - /** - * Set the message value. - * - * @param message the message value to set - * @return the CheckNameAvailabilityOutputInner object itself. - */ - public CheckNameAvailabilityOutputInner withMessage(String message) { - this.message = message; - return this; - } - } 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 index 6a930229f6f..c7d8eed157a 100644 --- 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 @@ -10,15 +10,16 @@ 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.Resource; /** - * Customer provided domain for branding purposes, e.g. www.consoto.com. + * 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 Resource { +public class CustomDomainInner extends ProxyResourceInner { /** * The host name of the custom domain. Must be a domain name. */ @@ -33,12 +34,27 @@ public class CustomDomainInner extends Resource { private CustomDomainResourceState resourceState; /** - * Provisioning state of Custom Https of the custom domain. Possible values - * include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed'. + * 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 @@ -91,6 +107,15 @@ public CustomHttpsProvisioningState customHttpsProvisioningState() { return this.customHttpsProvisioningState; } + /** + * Get the customHttpsProvisioningSubstate value. + * + * @return the customHttpsProvisioningSubstate value + */ + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.customHttpsProvisioningSubstate; + } + /** * Get the validationData value. * 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 index b3c8aceef7e..2e432e52aca 100644 --- 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 @@ -814,8 +814,8 @@ public Observable> call(Response disableCustomHttpsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(202, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -915,8 +915,8 @@ public Observable> call(Response enableCustomHttpsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(202, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(202, 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 index a7ad7d65a6d..c9e2b6217e7 100644 --- 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 @@ -12,13 +12,13 @@ import com.microsoft.azure.management.cdn.IpAddressGroup; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.Resource; /** - * Edge node of CDN service. + * Edgenode is a global Point of Presence (POP) location used to deliver CDN + * content to end users. */ @JsonFlatten -public class EdgeNodeInner extends Resource { +public class EdgeNodeInner extends ProxyResourceInner { /** * List of ip address groups. */ 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 index 5109f191c72..e7130879fde 100644 --- 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 @@ -66,7 +66,7 @@ interface EdgeNodesService { } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -84,7 +84,7 @@ public Page nextPage(String nextPageLink) { } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -103,7 +103,7 @@ public Observable>> call(String nextPageLink } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -119,7 +119,7 @@ public Page call(ServiceResponse> response) { } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -139,7 +139,7 @@ public Observable>> call(ServiceResponse> listDelegate(Response nextPage(String nextPageLink) { } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -210,7 +210,7 @@ public Observable>> call(String nextPageLink } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -227,7 +227,7 @@ public Page call(ServiceResponse> response) { } /** - * Lists all the edge nodes of a CDN service. + * 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 @@ -248,7 +248,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation 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 index a32cca689dd..d1d80f1b84e 100644 --- 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 @@ -10,12 +10,13 @@ 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 @@ -23,16 +24,19 @@ * The CDN endpoint uses the URL format <endpointname>.azureedge.net. */ @JsonFlatten -public class EndpointInner extends Resource { +public class EndpointInner extends TrackedResourceInner { /** - * The host header CDN sends along with content requests to origin. The - * default value is the host name of the origin. + * 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; /** - * The path used when CDN sends request to origin. + * 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; @@ -69,28 +73,48 @@ public class EndpointInner extends Resource { private Boolean isHttpsAllowed; /** - * Defines the query string caching behavior. Possible values include: - * 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'. + * 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; /** - * Customer can specify what scenario they want this CDN endpoint to - * optimize, e.g. Download, Media services. With this information we can - * apply scenario driven optimization. + * 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 String optimizationType; + private OptimizationType optimizationType; /** - * List of rules defining user 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/. + * 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. @@ -262,7 +286,7 @@ public EndpointInner withQueryStringCachingBehavior(QueryStringCachingBehavior q * * @return the optimizationType value */ - public String optimizationType() { + public OptimizationType optimizationType() { return this.optimizationType; } @@ -272,11 +296,31 @@ public String optimizationType() { * @param optimizationType the optimizationType value to set * @return the EndpointInner object itself. */ - public EndpointInner withOptimizationType(String optimizationType) { + public EndpointInner withOptimizationType(OptimizationType optimizationType) { this.optimizationType = optimizationType; return this; } + /** + * Get the probePath value. + * + * @return the probePath value + */ + public String probePath() { + return this.probePath; + } + + /** + * Set the probePath value. + * + * @param probePath the probePath value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + /** * Get the geoFilters value. * @@ -297,6 +341,26 @@ public EndpointInner withGeoFilters(List geoFilters) { return this; } + /** + * Get the deliveryPolicy value. + * + * @return the deliveryPolicy value + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.deliveryPolicy; + } + + /** + * Set the deliveryPolicy value. + * + * @param deliveryPolicy the deliveryPolicy value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + this.deliveryPolicy = deliveryPolicy; + return this; + } + /** * Get the hostName value. * diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointUpdateParametersInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointUpdateParametersInner.java index e25e786fc29..87a3ad9c291 100644 --- a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointUpdateParametersInner.java +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/EndpointUpdateParametersInner.java @@ -11,12 +11,14 @@ import java.util.Map; 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.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** - * Properties required to create a new endpoint. + * Properties required to create or update an endpoint. */ @JsonFlatten public class EndpointUpdateParametersInner { @@ -27,14 +29,17 @@ public class EndpointUpdateParametersInner { private Map tags; /** - * The host header CDN sends along with content requests to origin. The - * default value is the host name of the origin. + * 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; /** - * The path used when CDN sends request to origin. + * 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; @@ -71,28 +76,48 @@ public class EndpointUpdateParametersInner { private Boolean isHttpsAllowed; /** - * Defines the query string caching behavior. Possible values include: - * 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'. + * 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; /** - * Customer can specify what scenario they want this CDN endpoint to - * optimize, e.g. Download, Media services. With this information we can - * apply scenario driven optimization. + * 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 String optimizationType; + private OptimizationType optimizationType; /** - * List of rules defining user 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/. + * 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 the tags value. * @@ -258,7 +283,7 @@ public EndpointUpdateParametersInner withQueryStringCachingBehavior(QueryStringC * * @return the optimizationType value */ - public String optimizationType() { + public OptimizationType optimizationType() { return this.optimizationType; } @@ -268,11 +293,31 @@ public String optimizationType() { * @param optimizationType the optimizationType value to set * @return the EndpointUpdateParametersInner object itself. */ - public EndpointUpdateParametersInner withOptimizationType(String optimizationType) { + public EndpointUpdateParametersInner withOptimizationType(OptimizationType optimizationType) { this.optimizationType = optimizationType; return this; } + /** + * Get the probePath value. + * + * @return the probePath value + */ + public String probePath() { + return this.probePath; + } + + /** + * Set the probePath value. + * + * @param probePath the probePath value to set + * @return the EndpointUpdateParametersInner object itself. + */ + public EndpointUpdateParametersInner withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + /** * Get the geoFilters value. * @@ -293,4 +338,24 @@ public EndpointUpdateParametersInner withGeoFilters(List geoFilters) return this; } + /** + * Get the deliveryPolicy value. + * + * @return the deliveryPolicy value + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.deliveryPolicy; + } + + /** + * Set the deliveryPolicy value. + * + * @param deliveryPolicy the deliveryPolicy value to set + * @return the EndpointUpdateParametersInner object itself. + */ + public EndpointUpdateParametersInner withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + this.deliveryPolicy = deliveryPolicy; + return this; + } + } 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 index a3cbe5b61a3..7273cb4bf18 100644 --- 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 @@ -1069,6 +1069,7 @@ public Observable> call(Response re 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); @@ -1238,6 +1239,7 @@ public Observable> call(Response re 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); @@ -1425,6 +1427,7 @@ public Observable> call(Response response) { 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); @@ -1612,6 +1615,7 @@ public Observable> call(Response response) { 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); 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 index 10372f903d1..80657b99de5 100644 --- 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 @@ -18,7 +18,7 @@ public class OperationInner { /** * Operation name: {provider}/{resource}/{operation}. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /** @@ -36,17 +36,6 @@ public String name() { return this.name; } - /** - * Set the name value. - * - * @param name the name value to set - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - /** * Get the display value. * 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 00000000000..fc0f688fbcf --- /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 index d58ddc0cb69..76566cd6926 100644 --- 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 @@ -11,7 +11,6 @@ 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 @@ -19,7 +18,7 @@ * cached, they attempt to fetch it from one or more of the configured origins. */ @JsonFlatten -public class OriginInner extends Resource { +public class OriginInner extends TrackedResourceInner { /** * The address of the origin. Domain names, IPv4 addresses, and IPv6 * addresses are supported. 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 index 6e7845a4719..cbc558812f8 100644 --- 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 @@ -12,16 +12,13 @@ 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 represents the top level resource and the entry point into the - * CDN API. This allows users to set up a logical grouping of endpoints in - * addition to creating shared configuration settings and selecting pricing - * tiers and providers. + * 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 { +public class ProfileInner extends TrackedResourceInner { /** * The pricing tier (defines a CDN provider, feature list and rate) of the * CDN profile. 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 index 2ba579e139d..2bc6d3e93a6 100644 --- 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 @@ -108,6 +108,10 @@ interface ProfilesService { @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); @@ -607,6 +611,77 @@ private ServiceResponse beginCreateDelegate(Response .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. * @@ -676,9 +751,6 @@ public Observable> updateWithServiceResponseAsync( if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - if (tags == null) { - throw new IllegalArgumentException("Parameter tags is required and cannot be null."); - } Validator.validate(tags); ProfileUpdateParameters profileUpdateParameters = new ProfileUpdateParameters(); profileUpdateParameters.withTags(tags); @@ -686,6 +758,88 @@ public Observable> updateWithServiceResponseAsync( 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. * @@ -755,9 +909,6 @@ public Observable> beginUpdateWithServiceResponseA if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - if (tags == null) { - throw new IllegalArgumentException("Parameter tags is required and cannot be null."); - } Validator.validate(tags); ProfileUpdateParameters profileUpdateParameters = new ProfileUpdateParameters(); profileUpdateParameters.withTags(tags); @@ -1023,6 +1174,92 @@ private ServiceResponse generateSsoUriDelegate(Response 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. * diff --git a/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProxyResourceInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProxyResourceInner.java new file mode 100644 index 00000000000..31d713d7534 --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/ProxyResourceInner.java @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn.implementation; + +import com.microsoft.azure.Resource; + +/** + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags. + */ +public class ProxyResourceInner extends Resource { +} 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 index eb07d005f36..4c67aa3e5ef 100644 --- 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 @@ -15,27 +15,27 @@ */ public class ResourceUsageInner { /** - * Resource type of the usages. + * Resource type for which the usage is provided. */ - @JsonProperty(value = "resourceType") + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) private String resourceType; /** * Unit of the usage. e.g. Count. */ - @JsonProperty(value = "unit") + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; /** - * Actual value of the resource type. + * Actual value of usage on the specified resource type. */ - @JsonProperty(value = "currentValue") + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) private Integer currentValue; /** - * Quota of the resource type. + * Quota of the specified resource type. */ - @JsonProperty(value = "limit") + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) private Integer limit; /** @@ -47,17 +47,6 @@ public String resourceType() { return this.resourceType; } - /** - * Set the resourceType value. - * - * @param resourceType the resourceType value to set - * @return the ResourceUsageInner object itself. - */ - public ResourceUsageInner withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - /** * Get the unit value. * @@ -67,17 +56,6 @@ public String unit() { return this.unit; } - /** - * Set the unit value. - * - * @param unit the unit value to set - * @return the ResourceUsageInner object itself. - */ - public ResourceUsageInner withUnit(String unit) { - this.unit = unit; - return this; - } - /** * Get the currentValue value. * @@ -87,17 +65,6 @@ public Integer currentValue() { return this.currentValue; } - /** - * Set the currentValue value. - * - * @param currentValue the currentValue value to set - * @return the ResourceUsageInner object itself. - */ - public ResourceUsageInner withCurrentValue(Integer currentValue) { - this.currentValue = currentValue; - return this; - } - /** * Get the limit value. * @@ -107,15 +74,4 @@ public Integer limit() { return this.limit; } - /** - * Set the limit value. - * - * @param limit the limit value to set - * @return the ResourceUsageInner object itself. - */ - public ResourceUsageInner withLimit(Integer limit) { - this.limit = limit; - return this; - } - } 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 00000000000..a0d8a087a9d --- /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 index 386d7da9ca5..24d1cecf317 100644 --- 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 @@ -11,13 +11,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * SSO URI required to login to the supplemental portal. + * 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") + @JsonProperty(value = "ssoUriValue", access = JsonProperty.Access.WRITE_ONLY) private String ssoUriValue; /** @@ -29,15 +29,4 @@ public String ssoUriValue() { return this.ssoUriValue; } - /** - * Set the ssoUriValue value. - * - * @param ssoUriValue the ssoUriValue value to set - * @return the SsoUriInner object itself. - */ - public SsoUriInner withSsoUriValue(String ssoUriValue) { - this.ssoUriValue = ssoUriValue; - return this; - } - } 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 00000000000..69a094778e2 --- /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 the supportedOptimizationTypes value. + * + * @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/TrackedResourceInner.java b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/TrackedResourceInner.java new file mode 100644 index 00000000000..17d61452ceb --- /dev/null +++ b/azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/TrackedResourceInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cdn.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The resource model definition for a ARM tracked top level resource. + */ +public class TrackedResourceInner extends Resource { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} 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 index 5cc5f6890f9..afbbe63bbe2 100644 --- 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 @@ -15,21 +15,21 @@ */ public class ValidateCustomDomainOutputInner { /** - * Indicates whether the custom domain is validated or not. + * Indicates whether the custom domain is valid or not. */ - @JsonProperty(value = "customDomainValidated") + @JsonProperty(value = "customDomainValidated", access = JsonProperty.Access.WRITE_ONLY) private Boolean customDomainValidated; /** * The reason why the custom domain is not valid. */ - @JsonProperty(value = "reason") + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private String reason; /** * Error message describing why the custom domain is not valid. */ - @JsonProperty(value = "message") + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** @@ -41,17 +41,6 @@ public Boolean customDomainValidated() { return this.customDomainValidated; } - /** - * Set the customDomainValidated value. - * - * @param customDomainValidated the customDomainValidated value to set - * @return the ValidateCustomDomainOutputInner object itself. - */ - public ValidateCustomDomainOutputInner withCustomDomainValidated(Boolean customDomainValidated) { - this.customDomainValidated = customDomainValidated; - return this; - } - /** * Get the reason value. * @@ -61,17 +50,6 @@ public String reason() { return this.reason; } - /** - * Set the reason value. - * - * @param reason the reason value to set - * @return the ValidateCustomDomainOutputInner object itself. - */ - public ValidateCustomDomainOutputInner withReason(String reason) { - this.reason = reason; - return this; - } - /** * Get the message value. * @@ -81,15 +59,4 @@ public String message() { return this.message; } - /** - * Set the message value. - * - * @param message the message value to set - * @return the ValidateCustomDomainOutputInner object itself. - */ - public ValidateCustomDomainOutputInner withMessage(String message) { - this.message = message; - return this; - } - } 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 00000000000..a1d9020a39e --- /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 the isValid value. + * + * @return the isValid value + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Get the errorCode value. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + +}