diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/CheckAvailabilityParameters.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/CheckAvailabilityParameters.java new file mode 100644 index 00000000000..1d6ceef597a --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/CheckAvailabilityParameters.java @@ -0,0 +1,180 @@ +/** + * 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.notificationhubs; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ +public class CheckAvailabilityParameters { + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * True if the name is available and can be used to create new + * Namespace/NotificationHub. Otherwise false. + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * 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 CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters 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 CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the isAvailiable value. + * + * @return the isAvailiable value + */ + public Boolean isAvailiable() { + return this.isAvailiable; + } + + /** + * Set the isAvailiable value. + * + * @param isAvailiable the isAvailiable value to set + * @return the CheckAvailabilityParameters object itself. + */ + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; + return this; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/ErrorResponse.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/ErrorResponse.java new file mode 100644 index 00000000000..ba7b33e17c5 --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/ErrorResponse.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.notificationhubs; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error reponse indicates NotificationHubs service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/ErrorResponseException.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/ErrorResponseException.java new file mode 100644 index 00000000000..701ff653c27 --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/NamespacePatchParameters.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/NamespacePatchParameters.java new file mode 100644 index 00000000000..57f4e86d86d --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/NamespacePatchParameters.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.notificationhubs; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Patch Namespace operation. + */ +public class NamespacePatchParameters { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * 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 NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/OperationDisplay.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/OperationDisplay.java new file mode 100644 index 00000000000..273c01c125d --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/OperationDisplay.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.NotificationHubs. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed: Invoice, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java new file mode 100644 index 00000000000..56d60792298 --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleCreateOrUpdateParameters.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.notificationhubs; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + */ +public class SharedAccessAuthorizationRuleCreateOrUpdateParameters { + /** + * Properties of the Namespace AuthorizationRules. + */ + @JsonProperty(value = "properties", required = true) + private SharedAccessAuthorizationRuleProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. + */ + public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleProperties.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleProperties.java index 2c341a56e00..326eb1efde2 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleProperties.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SharedAccessAuthorizationRuleProperties.java @@ -21,6 +21,56 @@ public class SharedAccessAuthorizationRuleProperties { @JsonProperty(value = "rights") private List rights; + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * A string that describes the claim type. + */ + @JsonProperty(value = "claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /** + * A string that describes the claim value. + */ + @JsonProperty(value = "claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /** + * The last modified time for this rule. + */ + @JsonProperty(value = "modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedTime; + + /** + * The created time for this rule. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private String createdTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + /** * Get the rights value. * @@ -41,4 +91,76 @@ public SharedAccessAuthorizationRuleProperties withRights(List rig return this; } + /** + * Get the primaryKey value. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get the secondaryKey value. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get the keyName value. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get the claimType value. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Get the claimValue value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the modifiedTime value. + * + * @return the modifiedTime value + */ + public String modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the createdTime value. + * + * @return the createdTime value + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Get the revision value. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SkuName.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SkuName.java index 8c3bb8f07ba..58d17241431 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SkuName.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/SkuName.java @@ -8,55 +8,37 @@ package com.microsoft.azure.management.notificationhubs; -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 Free for SkuName. */ - public static final SkuName FREE = new SkuName("Free"); + public static final SkuName FREE = fromString("Free"); /** Static value Basic for SkuName. */ - public static final SkuName BASIC = new SkuName("Basic"); + public static final SkuName BASIC = fromString("Basic"); /** Static value Standard for SkuName. */ - public static final SkuName STANDARD = new SkuName("Standard"); - - private String value; + public static final SkuName STANDARD = fromString("Standard"); /** - * 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-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/CheckAvailabilityResultInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/CheckAvailabilityResultInner.java index 8cd7a5ed5c2..2b67eaa426d 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/CheckAvailabilityResultInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/CheckAvailabilityResultInner.java @@ -8,12 +8,15 @@ package com.microsoft.azure.management.notificationhubs.implementation; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Description of a CheckAvailibility resource. */ +@SkipParentValidation public class CheckAvailabilityResultInner extends Resource { /** * True if the name is available and can be used to create new @@ -22,6 +25,12 @@ public class CheckAvailabilityResultInner extends Resource { @JsonProperty(value = "isAvailiable") private Boolean isAvailiable; + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the isAvailiable value. * @@ -42,4 +51,24 @@ public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { return this; } + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withSku(Sku sku) { + this.sku = sku; + return this; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceCreateOrUpdateParametersInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceCreateOrUpdateParametersInner.java index 0ae0706f893..1aa3464debc 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceCreateOrUpdateParametersInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceCreateOrUpdateParametersInner.java @@ -10,14 +10,17 @@ import org.joda.time.DateTime; import com.microsoft.azure.management.notificationhubs.NamespaceType; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Parameters supplied to the CreateOrUpdate Namespace operation. */ @JsonFlatten +@SkipParentValidation public class NamespaceCreateOrUpdateParametersInner extends Resource { /** * The name of the namespace. @@ -41,6 +44,12 @@ public class NamespaceCreateOrUpdateParametersInner extends Resource { @JsonProperty(value = "properties.region") private String region; + /** + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + /** * Status of the namespace. It can be any of these values:1 = * Created/Active2 = Creating3 = Suspended4 = Deleting. @@ -54,6 +63,12 @@ public class NamespaceCreateOrUpdateParametersInner extends Resource { @JsonProperty(value = "properties.createdAt") private DateTime createdAt; + /** + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt") + private DateTime updatedAt; + /** * Endpoint you can use to perform NotificationHub operations. */ @@ -84,6 +99,12 @@ public class NamespaceCreateOrUpdateParametersInner extends Resource { @JsonProperty(value = "properties.critical") private Boolean critical; + /** + * Data center for the namespace. + */ + @JsonProperty(value = "properties.dataCenter") + private String dataCenter; + /** * The namespace type. Possible values include: 'Messaging', * 'NotificationHub'. @@ -91,6 +112,12 @@ public class NamespaceCreateOrUpdateParametersInner extends Resource { @JsonProperty(value = "properties.namespaceType") private NamespaceType namespaceType; + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the namespaceCreateOrUpdateParametersName value. * @@ -151,6 +178,15 @@ public NamespaceCreateOrUpdateParametersInner withRegion(String region) { return this; } + /** + * Get the metricId value. + * + * @return the metricId value + */ + public String metricId() { + return this.metricId; + } + /** * Get the status value. * @@ -191,6 +227,26 @@ public NamespaceCreateOrUpdateParametersInner withCreatedAt(DateTime createdAt) return this; } + /** + * Get the updatedAt value. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Set the updatedAt value. + * + * @param updatedAt the updatedAt value to set + * @return the NamespaceCreateOrUpdateParametersInner object itself. + */ + public NamespaceCreateOrUpdateParametersInner withUpdatedAt(DateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + /** * Get the serviceBusEndpoint value. * @@ -291,6 +347,26 @@ public NamespaceCreateOrUpdateParametersInner withCritical(Boolean critical) { return this; } + /** + * Get the dataCenter value. + * + * @return the dataCenter value + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set the dataCenter value. + * + * @param dataCenter the dataCenter value to set + * @return the NamespaceCreateOrUpdateParametersInner object itself. + */ + public NamespaceCreateOrUpdateParametersInner withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + /** * Get the namespaceType value. * @@ -311,4 +387,24 @@ public NamespaceCreateOrUpdateParametersInner withNamespaceType(NamespaceType na return this; } + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the NamespaceCreateOrUpdateParametersInner object itself. + */ + public NamespaceCreateOrUpdateParametersInner withSku(Sku sku) { + this.sku = sku; + return this; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceResourceInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceResourceInner.java index 56cc9cae0c1..38fe4115426 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceResourceInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespaceResourceInner.java @@ -10,14 +10,17 @@ import org.joda.time.DateTime; import com.microsoft.azure.management.notificationhubs.NamespaceType; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Description of a Namespace resource. */ @JsonFlatten +@SkipParentValidation public class NamespaceResourceInner extends Resource { /** * The name of the namespace. @@ -41,6 +44,12 @@ public class NamespaceResourceInner extends Resource { @JsonProperty(value = "properties.region") private String region; + /** + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + /** * Status of the namespace. It can be any of these values:1 = * Created/Active2 = Creating3 = Suspended4 = Deleting. @@ -54,6 +63,12 @@ public class NamespaceResourceInner extends Resource { @JsonProperty(value = "properties.createdAt") private DateTime createdAt; + /** + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt") + private DateTime updatedAt; + /** * Endpoint you can use to perform NotificationHub operations. */ @@ -84,6 +99,12 @@ public class NamespaceResourceInner extends Resource { @JsonProperty(value = "properties.critical") private Boolean critical; + /** + * Data center for the namespace. + */ + @JsonProperty(value = "properties.dataCenter") + private String dataCenter; + /** * The namespace type. Possible values include: 'Messaging', * 'NotificationHub'. @@ -91,6 +112,12 @@ public class NamespaceResourceInner extends Resource { @JsonProperty(value = "properties.namespaceType") private NamespaceType namespaceType; + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the namespaceResourceName value. * @@ -151,6 +178,15 @@ public NamespaceResourceInner withRegion(String region) { return this; } + /** + * Get the metricId value. + * + * @return the metricId value + */ + public String metricId() { + return this.metricId; + } + /** * Get the status value. * @@ -191,6 +227,26 @@ public NamespaceResourceInner withCreatedAt(DateTime createdAt) { return this; } + /** + * Get the updatedAt value. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Set the updatedAt value. + * + * @param updatedAt the updatedAt value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withUpdatedAt(DateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + /** * Get the serviceBusEndpoint value. * @@ -291,6 +347,26 @@ public NamespaceResourceInner withCritical(Boolean critical) { return this; } + /** + * Get the dataCenter value. + * + * @return the dataCenter value + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set the dataCenter value. + * + * @param dataCenter the dataCenter value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + /** * Get the namespaceType value. * @@ -311,4 +387,24 @@ public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { return this; } + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the NamespaceResourceInner object itself. + */ + public NamespaceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespacesInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespacesInner.java index b6254f0969d..8682468e8ee 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespacesInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespacesInner.java @@ -10,12 +10,17 @@ import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.CheckAvailabilityParameters; +import com.microsoft.azure.management.notificationhubs.NamespacePatchParameters; import com.microsoft.azure.management.notificationhubs.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.SharedAccessAuthorizationRuleProperties; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -44,7 +49,7 @@ * An instance of this class provides access to all the operations defined * in Namespaces. */ -public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete { +public class NamespacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private NamespacesService service; /** The service client containing this operation class. */ @@ -68,7 +73,7 @@ public NamespacesInner(Retrofit retrofit, NotificationHubsManagementClientImpl c interface NamespacesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces checkAvailability" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") - Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> checkAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.Namespaces createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") @@ -76,7 +81,7 @@ interface NamespacesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces patch" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") - Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespacePatchParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body NamespacePatchParameters parameters, @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.notificationhubs.Namespaces delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", method = "DELETE", hasBody = true) @@ -92,7 +97,7 @@ interface NamespacesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces createOrUpdateAuthorizationRule" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") - Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces deleteAuthorizationRule" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) @@ -102,13 +107,13 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.notificationhubs.Namespaces list" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") - Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listAll" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") - Observable> listAll(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.notificationhubs.Namespaces listAuthorizationRules" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") @@ -122,13 +127,13 @@ interface NamespacesService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PolicykeyResource parameters, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listNext" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listByResourceGroupNext" }) @GET - Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listAllNext" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listNext" }) @GET - Observable> listAllNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.Namespaces listAuthorizationRulesNext" }) @GET @@ -145,7 +150,7 @@ interface NamespacesService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CheckAvailabilityResultInner object if successful. */ - public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParametersInner parameters) { + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { return checkAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); } @@ -157,7 +162,7 @@ public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameter * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture checkAvailabilityAsync(CheckAvailabilityParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback); } @@ -168,7 +173,7 @@ public ServiceFuture checkAvailabilityAsync(CheckA * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CheckAvailabilityResultInner object */ - public Observable checkAvailabilityAsync(CheckAvailabilityParametersInner parameters) { + public Observable checkAvailabilityAsync(CheckAvailabilityParameters parameters) { return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1, CheckAvailabilityResultInner>() { @Override public CheckAvailabilityResultInner call(ServiceResponse response) { @@ -184,7 +189,7 @@ public CheckAvailabilityResultInner call(ServiceResponse> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParametersInner parameters) { + public Observable> checkAvailabilityWithServiceResponseAsync(CheckAvailabilityParameters parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -305,8 +310,8 @@ public Observable> call(Response createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -322,7 +327,7 @@ private ServiceResponse createOrUpdateDelegate(Response< * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the NamespaceResourceInner object if successful. */ - public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParametersInner parameters) { + public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } @@ -336,7 +341,7 @@ public NamespaceResourceInner patch(String resourceGroupName, String namespaceNa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } @@ -349,7 +354,7 @@ public ServiceFuture patchAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NamespaceResourceInner object */ - public Observable patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParametersInner parameters) { + public Observable patchAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { return patchWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NamespaceResourceInner>() { @Override public NamespaceResourceInner call(ServiceResponse response) { @@ -367,7 +372,7 @@ public NamespaceResourceInner call(ServiceResponse respo * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NamespaceResourceInner object */ - public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespacePatchParametersInner parameters) { + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -553,9 +558,9 @@ public Observable> call(Response response) { private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -652,14 +657,14 @@ private ServiceResponse getByResourceGroupDelegate(Respo * @param resourceGroupName The name of the resource group. * @param namespaceName The namespace name. * @param authorizationRuleName Aauthorization Rule Name. - * @param parameters The shared access authorization rule. + * @param properties Properties of the Namespace AuthorizationRules. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SharedAccessAuthorizationRuleResourceInner object if successful. */ - public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties).toBlocking().single().body(); } /** @@ -668,13 +673,13 @@ public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRul * @param resourceGroupName The name of the resource group. * @param namespaceName The namespace name. * @param authorizationRuleName Aauthorization Rule Name. - * @param parameters The shared access authorization rule. + * @param properties Properties of the Namespace AuthorizationRules. * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties), serviceCallback); } /** @@ -683,12 +688,12 @@ public ServiceFuture createOrUpdateA * @param resourceGroupName The name of the resource group. * @param namespaceName The namespace name. * @param authorizationRuleName Aauthorization Rule Name. - * @param parameters The shared access authorization rule. + * @param properties Properties of the Namespace AuthorizationRules. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SharedAccessAuthorizationRuleResourceInner object */ - public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, properties).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { @Override public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { return response.body(); @@ -702,11 +707,11 @@ public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -719,14 +724,16 @@ public Observable> c if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(parameters); - return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + parameters.withProperties(properties); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -834,8 +841,8 @@ public Observable> call(Response response) { private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -942,12 +949,12 @@ private ServiceResponse getAuthoriza * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<NamespaceResourceInner> object if successful. */ - public PagedList list(final String resourceGroupName) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } @@ -960,13 +967,13 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName), + listByResourceGroupSinglePageAsync(resourceGroupName), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); + return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); @@ -979,8 +986,8 @@ public Observable>> call(String nex * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<NamespaceResourceInner> object */ - public Observable> listAsync(final String resourceGroupName) { - return listWithServiceResponseAsync(resourceGroupName) + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -996,8 +1003,8 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync(final String resourceGroupName) { - return listSinglePageAsync(resourceGroupName) + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -1005,7 +1012,7 @@ public Observable>> call(ServiceRes if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1017,7 +1024,7 @@ public Observable>> call(ServiceRes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1027,12 +1034,12 @@ public Observable>> listSinglePageA if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.list(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listByResourceGroupDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -1041,7 +1048,7 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) @@ -1056,12 +1063,12 @@ private ServiceResponse> listDelegate(Response< * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<NamespaceResourceInner> object if successful. */ - public PagedList listAll() { - ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { - return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } @@ -1073,13 +1080,13 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAllAsync(final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listAllSinglePageAsync(), + listSinglePageAsync(), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { - return listAllNextSinglePageAsync(nextPageLink); + return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); @@ -1091,8 +1098,8 @@ public Observable>> call(String nex * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<NamespaceResourceInner> object */ - public Observable> listAllAsync() { - return listAllWithServiceResponseAsync() + public Observable> listAsync() { + return listWithServiceResponseAsync() .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -1107,8 +1114,8 @@ public Page call(ServiceResponse>> listAllWithServiceResponseAsync() { - return listAllSinglePageAsync() + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -1116,7 +1123,7 @@ public Observable>> call(ServiceRes if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1127,19 +1134,19 @@ public Observable>> call(ServiceRes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listAllSinglePageAsync() { + 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.listAll(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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 = listAllDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -1148,7 +1155,7 @@ public Observable>> call(Response> listAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) @@ -1287,9 +1294,9 @@ private ServiceResponse> li * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ResourceListKeysInner object if successful. + * @return the SharedAccessAuthorizationRuleListResultInner object if successful. */ - public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + public SharedAccessAuthorizationRuleListResultInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } @@ -1303,7 +1310,7 @@ public ResourceListKeysInner listKeys(String resourceGroupName, String namespace * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } @@ -1314,12 +1321,12 @@ public ServiceFuture listKeysAsync(String resourceGroupNa * @param namespaceName The namespace name. * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceListKeysInner object + * @return the observable to the SharedAccessAuthorizationRuleListResultInner object */ - public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, ResourceListKeysInner>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SharedAccessAuthorizationRuleListResultInner>() { @Override - public ResourceListKeysInner call(ServiceResponse response) { + public SharedAccessAuthorizationRuleListResultInner call(ServiceResponse response) { return response.body(); } }); @@ -1332,9 +1339,9 @@ public ResourceListKeysInner call(ServiceResponse respons * @param namespaceName The namespace name. * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ResourceListKeysInner object + * @return the observable to the SharedAccessAuthorizationRuleListResultInner object */ - public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1351,11 +1358,11 @@ public Observable> listKeysWithServiceRes throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = listKeysDelegate(response); + ServiceResponse clientResponse = listKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1364,9 +1371,9 @@ public Observable> call(Response listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -1568,12 +1575,12 @@ private ServiceResponse regenerateKeysDelegate(Response listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } @@ -1587,13 +1594,13 @@ public Page nextPage(String nextPageLink) { * @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) { + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), + listByResourceGroupNextSinglePageAsync(nextPageLink), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); + return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); @@ -1606,8 +1613,8 @@ public Observable>> call(String nex * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<NamespaceResourceInner> object */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -1623,8 +1630,8 @@ public Page call(ServiceResponse>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -1632,7 +1639,7 @@ public Observable>> call(ServiceRes if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1644,17 +1651,17 @@ public Observable>> call(ServiceRes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listByResourceGroupNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -1663,7 +1670,7 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) @@ -1679,12 +1686,12 @@ private ServiceResponse> listNextDelegate(Respo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<NamespaceResourceInner> object if successful. */ - public PagedList listAllNext(final String nextPageLink) { - ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { - return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } @@ -1698,13 +1705,13 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAllNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listAllNextSinglePageAsync(nextPageLink), + listNextSinglePageAsync(nextPageLink), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { - return listAllNextSinglePageAsync(nextPageLink); + return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); @@ -1717,8 +1724,8 @@ public Observable>> call(String nex * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<NamespaceResourceInner> object */ - public Observable> listAllNextAsync(final String nextPageLink) { - return listAllNextWithServiceResponseAsync(nextPageLink) + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -1734,8 +1741,8 @@ public Page call(ServiceResponse>> listAllNextWithServiceResponseAsync(final String nextPageLink) { - return listAllNextSinglePageAsync(nextPageLink) + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -1743,7 +1750,7 @@ public Observable>> call(ServiceRes if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1755,17 +1762,17 @@ public Observable>> call(ServiceRes * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<NamespaceResourceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { + 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.listAllNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listAllNextDelegate(response); + ServiceResponse> result = listNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -1774,7 +1781,7 @@ public Observable>> call(Response> listAllNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubCreateOrUpdateParametersInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubCreateOrUpdateParametersInner.java index ea84a1fd8b6..a1c2584d14f 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubCreateOrUpdateParametersInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubCreateOrUpdateParametersInner.java @@ -16,14 +16,17 @@ import com.microsoft.azure.management.notificationhubs.MpnsCredential; import com.microsoft.azure.management.notificationhubs.AdmCredential; import com.microsoft.azure.management.notificationhubs.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Parameters supplied to the CreateOrUpdate NotificationHub operation. */ @JsonFlatten +@SkipParentValidation public class NotificationHubCreateOrUpdateParametersInner extends Resource { /** * The NotificationHub name. @@ -79,6 +82,12 @@ public class NotificationHubCreateOrUpdateParametersInner extends Resource { @JsonProperty(value = "properties.baiduCredential") private BaiduCredential baiduCredential; + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the notificationHubCreateOrUpdateParametersName value. * @@ -259,4 +268,24 @@ public NotificationHubCreateOrUpdateParametersInner withBaiduCredential(BaiduCre return this; } + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the NotificationHubCreateOrUpdateParametersInner object itself. + */ + public NotificationHubCreateOrUpdateParametersInner withSku(Sku sku) { + this.sku = sku; + return this; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubResourceInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubResourceInner.java index df54e643d9b..2cd30fe2ad4 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubResourceInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubResourceInner.java @@ -16,14 +16,17 @@ import com.microsoft.azure.management.notificationhubs.MpnsCredential; import com.microsoft.azure.management.notificationhubs.AdmCredential; import com.microsoft.azure.management.notificationhubs.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Description of a NotificationHub Resource. */ @JsonFlatten +@SkipParentValidation public class NotificationHubResourceInner extends Resource { /** * The NotificationHub name. @@ -79,6 +82,12 @@ public class NotificationHubResourceInner extends Resource { @JsonProperty(value = "properties.baiduCredential") private BaiduCredential baiduCredential; + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the notificationHubResourceName value. * @@ -259,4 +268,24 @@ public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCre return this; } + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsInner.java index a4cc9328167..4d1d30f1a2f 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsInner.java @@ -13,7 +13,10 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.notificationhubs.CheckAvailabilityParameters; import com.microsoft.azure.management.notificationhubs.PolicykeyResource; +import com.microsoft.azure.management.notificationhubs.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.microsoft.azure.management.notificationhubs.SharedAccessAuthorizationRuleProperties; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -63,9 +66,9 @@ public NotificationHubsInner(Retrofit retrofit, NotificationHubsManagementClient * used by Retrofit to perform actually REST calls. */ interface NotificationHubsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.NotificationHubs checkAvailability" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.NotificationHubs checkNotificationHubAvailability" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") - Observable> checkAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> checkNotificationHubAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body CheckAvailabilityParameters parameters, @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.notificationhubs.NotificationHubs createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") @@ -81,7 +84,7 @@ interface NotificationHubsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.NotificationHubs createOrUpdateAuthorizationRule" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") - Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("notificationHubName") String notificationHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.notificationhubs.NotificationHubs deleteAuthorizationRule" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) @@ -132,8 +135,8 @@ interface NotificationHubsService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CheckAvailabilityResultInner object if successful. */ - public CheckAvailabilityResultInner checkAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParametersInner parameters) { - return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** @@ -146,8 +149,8 @@ public CheckAvailabilityResultInner checkAvailability(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** @@ -159,8 +162,8 @@ public ServiceFuture checkAvailabilityAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CheckAvailabilityResultInner object */ - public Observable checkAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParametersInner parameters) { - return checkAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResultInner>() { + public Observable checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, CheckAvailabilityResultInner>() { @Override public CheckAvailabilityResultInner call(ServiceResponse response) { return response.body(); @@ -177,7 +180,7 @@ public CheckAvailabilityResultInner call(ServiceResponse> checkAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParametersInner parameters) { + public Observable> checkNotificationHubAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -194,12 +197,12 @@ public Observable> checkAvailabili throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(parameters); - return service.checkAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.checkNotificationHubAvailability(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = checkAvailabilityDelegate(response); + ServiceResponse clientResponse = checkNotificationHubAvailabilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -208,7 +211,7 @@ public Observable> call(Response checkAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse checkNotificationHubAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -509,14 +512,14 @@ private ServiceResponse getDelegate(Response createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties), serviceCallback); } /** @@ -542,12 +545,12 @@ public ServiceFuture createOrUpdateA * @param namespaceName The namespace name. * @param notificationHubName The notification hub name. * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @param properties Properties of the Namespace AuthorizationRules. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SharedAccessAuthorizationRuleResourceInner object */ - public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties).map(new Func1, SharedAccessAuthorizationRuleResourceInner>() { @Override public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse response) { return response.body(); @@ -562,11 +565,11 @@ public SharedAccessAuthorizationRuleResourceInner call(ServiceResponse> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParametersInner parameters) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -582,14 +585,16 @@ public Observable> c if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(parameters); - return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + if (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); + parameters.withProperties(properties); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -704,8 +709,8 @@ public Observable> call(Response response) { private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsManagementClientImpl.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsManagementClientImpl.java index 17adfd9985b..f55de1e92e5 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsManagementClientImpl.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NotificationHubsManagementClientImpl.java @@ -133,29 +133,29 @@ public NotificationHubsManagementClientImpl withGenerateClientRequestId(boolean } /** - * The NamespacesInner object to access its operations. + * The OperationsInner object to access its operations. */ - private NamespacesInner namespaces; + private OperationsInner operations; /** - * Gets the NamespacesInner object to access its operations. - * @return the NamespacesInner object. + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. */ - public NamespacesInner namespaces() { - return this.namespaces; + public OperationsInner operations() { + return this.operations; } /** - * The NamesInner object to access its operations. + * The NamespacesInner object to access its operations. */ - private NamesInner names; + private NamespacesInner namespaces; /** - * Gets the NamesInner object to access its operations. - * @return the NamesInner object. + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. */ - public NamesInner names() { - return this.names; + public NamespacesInner namespaces() { + return this.namespaces; } /** @@ -171,19 +171,6 @@ public NotificationHubsInner notificationHubs() { return this.notificationHubs; } - /** - * The HubsInner object to access its operations. - */ - private HubsInner hubs; - - /** - * Gets the HubsInner object to access its operations. - * @return the HubsInner object. - */ - public HubsInner hubs() { - return this.hubs; - } - /** * Initializes an instance of NotificationHubsManagementClient client. * @@ -219,10 +206,9 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); this.namespaces = new NamespacesInner(restClient().retrofit(), this); - this.names = new NamesInner(restClient().retrofit(), this); this.notificationHubs = new NotificationHubsInner(restClient().retrofit(), this); - this.hubs = new HubsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/OperationInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/OperationInner.java new file mode 100644 index 00000000000..a4c214c40ea --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.notificationhubs.implementation; + +import com.microsoft.azure.management.notificationhubs.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A NotificationHubs REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/OperationsInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/OperationsInner.java new file mode 100644 index 00000000000..6c111777afd --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/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.notificationhubs.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.notificationhubs.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 NotificationHubsManagementClientImpl 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, NotificationHubsManagementClientImpl 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.notificationhubs.Operations list" }) + @GET("providers/Microsoft.NotificationHubs/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.notificationhubs.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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 NotificationHubs 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-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/PnsCredentialsResourceInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/PnsCredentialsResourceInner.java index fd31c979816..67222c60a12 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/PnsCredentialsResourceInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/PnsCredentialsResourceInner.java @@ -14,14 +14,17 @@ import com.microsoft.azure.management.notificationhubs.MpnsCredential; import com.microsoft.azure.management.notificationhubs.AdmCredential; import com.microsoft.azure.management.notificationhubs.BaiduCredential; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Description of a NotificationHub PNS Credentials. */ @JsonFlatten +@SkipParentValidation public class PnsCredentialsResourceInner extends Resource { /** * The ApnsCredential of the created NotificationHub. @@ -59,6 +62,12 @@ public class PnsCredentialsResourceInner extends Resource { @JsonProperty(value = "properties.baiduCredential") private BaiduCredential baiduCredential; + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the apnsCredential value. * @@ -179,4 +188,24 @@ public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCred return this; } + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the PnsCredentialsResourceInner object itself. + */ + public PnsCredentialsResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + } diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleListResultInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleListResultInner.java new file mode 100644 index 00000000000..8b5268b0343 --- /dev/null +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleListResultInner.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.notificationhubs.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response of the List Namespace operation. + */ +public class SharedAccessAuthorizationRuleListResultInner { + /** + * Result of the List AuthorizationRules operation. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Link to the next set of results. Not empty if Value contains incomplete + * list of AuthorizationRules. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the SharedAccessAuthorizationRuleListResultInner object itself. + */ + public SharedAccessAuthorizationRuleListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink value. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink value. + * + * @param nextLink the nextLink value to set + * @return the SharedAccessAuthorizationRuleListResultInner object itself. + */ + public SharedAccessAuthorizationRuleListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceInner.java b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceInner.java index a8c1b76cd9c..1af8dbf6480 100644 --- a/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceInner.java +++ b/azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceInner.java @@ -10,14 +10,17 @@ import java.util.List; import com.microsoft.azure.management.notificationhubs.AccessRights; +import com.microsoft.azure.management.notificationhubs.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Description of a Namespace AuthorizationRules. */ @JsonFlatten +@SkipParentValidation public class SharedAccessAuthorizationRuleResourceInner extends Resource { /** * The rights associated with the rule. @@ -25,6 +28,62 @@ public class SharedAccessAuthorizationRuleResourceInner extends Resource { @JsonProperty(value = "properties.rights") private List rights; + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "properties.primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "properties.secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "properties.keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * A string that describes the claim type. + */ + @JsonProperty(value = "properties.claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /** + * A string that describes the claim value. + */ + @JsonProperty(value = "properties.claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /** + * The last modified time for this rule. + */ + @JsonProperty(value = "properties.modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedTime; + + /** + * The created time for this rule. + */ + @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) + private String createdTime; + + /** + * The revision number for the rule. + */ + @JsonProperty(value = "properties.revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + + /** + * The sku of the created namespace. + */ + @JsonProperty(value = "sku") + private Sku sku; + /** * Get the rights value. * @@ -45,4 +104,96 @@ public SharedAccessAuthorizationRuleResourceInner withRights(List return this; } + /** + * Get the primaryKey value. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get the secondaryKey value. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get the keyName value. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get the claimType value. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Get the claimValue value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the modifiedTime value. + * + * @return the modifiedTime value + */ + public String modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the createdTime value. + * + * @return the createdTime value + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Get the revision value. + * + * @return the revision value + */ + public Integer revision() { + return this.revision; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + }