diff --git a/sdk/eventgrid/mgmt-v2020_06_01/pom.xml b/sdk/eventgrid/mgmt-v2020_06_01/pom.xml new file mode 100644 index 000000000000..ac5726711c82 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.eventgrid.v2020_06_01 + + com.microsoft.azure + azure-arm-parent + 1.3.1 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-eventgrid + 1.0.0-beta + jar + Microsoft Azure SDK for EventGrid Management + This package contains Microsoft EventGrid Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/AdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/AdvancedFilter.java new file mode 100644 index 000000000000..41d778df4c2a --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/AdvancedFilter.java @@ -0,0 +1,66 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This is the base type that represents an advanced filter. To configure an + * advanced filter, do not directly instantiate an object of this class. + * Instead, instantiate an object of a derived class such as + * BoolEqualsAdvancedFilter, NumberInAdvancedFilter, StringEqualsAdvancedFilter + * etc. depending on the type of the key based on which you want to filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = AdvancedFilter.class) +@JsonTypeName("AdvancedFilter") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "NumberIn", value = NumberInAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberNotIn", value = NumberNotInAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberLessThan", value = NumberLessThanAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberGreaterThan", value = NumberGreaterThanAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberLessThanOrEquals", value = NumberLessThanOrEqualsAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberGreaterThanOrEquals", value = NumberGreaterThanOrEqualsAdvancedFilter.class), + @JsonSubTypes.Type(name = "BoolEquals", value = BoolEqualsAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringIn", value = StringInAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringNotIn", value = StringNotInAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringBeginsWith", value = StringBeginsWithAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringEndsWith", value = StringEndsWithAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringContains", value = StringContainsAdvancedFilter.class) +}) +public class AdvancedFilter { + /** + * The field/property in the event based on which you want to filter. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the field/property in the event based on which you want to filter. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the field/property in the event based on which you want to filter. + * + * @param key the key value to set + * @return the AdvancedFilter object itself. + */ + public AdvancedFilter withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/AzureFunctionEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/AzureFunctionEventSubscriptionDestination.java new file mode 100644 index 000000000000..c76fcbab688e --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/AzureFunctionEventSubscriptionDestination.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the azure function destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = AzureFunctionEventSubscriptionDestination.class) +@JsonTypeName("AzureFunction") +@JsonFlatten +public class AzureFunctionEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource Id that represents the endpoint of the Azure Function + * destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Maximum number of events per batch. + */ + @JsonProperty(value = "properties.maxEventsPerBatch") + private Integer maxEventsPerBatch; + + /** + * Preferred batch size in Kilobytes. + */ + @JsonProperty(value = "properties.preferredBatchSizeInKilobytes") + private Integer preferredBatchSizeInKilobytes; + + /** + * Get the Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the AzureFunctionEventSubscriptionDestination object itself. + */ + public AzureFunctionEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get maximum number of events per batch. + * + * @return the maxEventsPerBatch value + */ + public Integer maxEventsPerBatch() { + return this.maxEventsPerBatch; + } + + /** + * Set maximum number of events per batch. + * + * @param maxEventsPerBatch the maxEventsPerBatch value to set + * @return the AzureFunctionEventSubscriptionDestination object itself. + */ + public AzureFunctionEventSubscriptionDestination withMaxEventsPerBatch(Integer maxEventsPerBatch) { + this.maxEventsPerBatch = maxEventsPerBatch; + return this; + } + + /** + * Get preferred batch size in Kilobytes. + * + * @return the preferredBatchSizeInKilobytes value + */ + public Integer preferredBatchSizeInKilobytes() { + return this.preferredBatchSizeInKilobytes; + } + + /** + * Set preferred batch size in Kilobytes. + * + * @param preferredBatchSizeInKilobytes the preferredBatchSizeInKilobytes value to set + * @return the AzureFunctionEventSubscriptionDestination object itself. + */ + public AzureFunctionEventSubscriptionDestination withPreferredBatchSizeInKilobytes(Integer preferredBatchSizeInKilobytes) { + this.preferredBatchSizeInKilobytes = preferredBatchSizeInKilobytes; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/BoolEqualsAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/BoolEqualsAdvancedFilter.java new file mode 100644 index 000000000000..99441cc34a94 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/BoolEqualsAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BoolEquals Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = BoolEqualsAdvancedFilter.class) +@JsonTypeName("BoolEquals") +public class BoolEqualsAdvancedFilter extends AdvancedFilter { + /** + * The boolean filter value. + */ + @JsonProperty(value = "value") + private Boolean value; + + /** + * Get the boolean filter value. + * + * @return the value value + */ + public Boolean value() { + return this.value; + } + + /** + * Set the boolean filter value. + * + * @param value the value value to set + * @return the BoolEqualsAdvancedFilter object itself. + */ + public BoolEqualsAdvancedFilter withValue(Boolean value) { + this.value = value; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ConnectionState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ConnectionState.java new file mode 100644 index 000000000000..816e1c8ab404 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ConnectionState.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ConnectionState information. + */ +public class ConnectionState { + /** + * Status of the connection. Possible values include: 'Pending', + * 'Approved', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private PersistedConnectionStatus status; + + /** + * Description of the connection state. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Actions required (if any). + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get status of the connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PersistedConnectionStatus status() { + return this.status; + } + + /** + * Set status of the connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the ConnectionState object itself. + */ + public ConnectionState withStatus(PersistedConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get description of the connection state. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the connection state. + * + * @param description the description value to set + * @return the ConnectionState object itself. + */ + public ConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get actions required (if any). + * + * @return the actionsRequired value + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set actions required (if any). + * + * @param actionsRequired the actionsRequired value to set + * @return the ConnectionState object itself. + */ + public ConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DeadLetterDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DeadLetterDestination.java new file mode 100644 index 000000000000..7315b8a4e507 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DeadLetterDestination.java @@ -0,0 +1,28 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the dead letter destination for an event subscription. To + * configure a deadletter destination, do not directly instantiate an object of + * this class. Instead, instantiate an object of a derived class. Currently, + * StorageBlobDeadLetterDestination is the only class that derives from this + * class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = DeadLetterDestination.class) +@JsonTypeName("DeadLetterDestination") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StorageBlob", value = StorageBlobDeadLetterDestination.class) +}) +public class DeadLetterDestination { +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Domain.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Domain.java new file mode 100644 index 000000000000..24d93c882b5e --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Domain.java @@ -0,0 +1,196 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.DomainInner; + +/** + * Type representing Domain. + */ +public interface Domain extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the inboundIpRules value. + */ + List inboundIpRules(); + + /** + * @return the inputSchema value. + */ + InputSchema inputSchema(); + + /** + * @return the inputSchemaMapping value. + */ + InputSchemaMapping inputSchemaMapping(); + + /** + * @return the metricResourceId value. + */ + String metricResourceId(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + DomainProvisioningState provisioningState(); + + /** + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * The entirety of the Domain definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Domain definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Domain definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Domain definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the domain definition allowing to specify InboundIpRules. + */ + interface WithInboundIpRules { + /** + * Specifies inboundIpRules. + * @param inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled + * @return the next definition stage + */ + WithCreate withInboundIpRules(List inboundIpRules); + } + + /** + * The stage of the domain definition allowing to specify InputSchema. + */ + interface WithInputSchema { + /** + * Specifies inputSchema. + * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0' + * @return the next definition stage + */ + WithCreate withInputSchema(InputSchema inputSchema); + } + + /** + * The stage of the domain definition allowing to specify InputSchemaMapping. + */ + interface WithInputSchemaMapping { + /** + * Specifies inputSchemaMapping. + * @param inputSchemaMapping Information about the InputSchemaMapping which specified the info about mapping event payload + * @return the next definition stage + */ + WithCreate withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); + } + + /** + * The stage of the domain definition allowing to specify PrivateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies privateEndpointConnections. + * @param privateEndpointConnections List of private endpoint connections + * @return the next definition stage + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + + /** + * The stage of the domain definition allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithInboundIpRules, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithPrivateEndpointConnections, DefinitionStages.WithPublicNetworkAccess { + } + } + /** + * The template for a Domain update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithInboundIpRules, UpdateStages.WithPublicNetworkAccess { + } + + /** + * Grouping of Domain update stages. + */ + interface UpdateStages { + /** + * The stage of the domain update allowing to specify InboundIpRules. + */ + interface WithInboundIpRules { + /** + * Specifies inboundIpRules. + * @param inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled + * @return the next update stage + */ + Update withInboundIpRules(List inboundIpRules); + } + + /** + * The stage of the domain update allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainUpdateParameterProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainProvisioningState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainProvisioningState.java new file mode 100644 index 000000000000..f4ad6667197d --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DomainProvisioningState. + */ +public final class DomainProvisioningState extends ExpandableStringEnum { + /** Static value Creating for DomainProvisioningState. */ + public static final DomainProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DomainProvisioningState. */ + public static final DomainProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for DomainProvisioningState. */ + public static final DomainProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for DomainProvisioningState. */ + public static final DomainProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for DomainProvisioningState. */ + public static final DomainProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for DomainProvisioningState. */ + public static final DomainProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DomainProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding DomainProvisioningState + */ + @JsonCreator + public static DomainProvisioningState fromString(String name) { + return fromString(name, DomainProvisioningState.class); + } + + /** + * @return known DomainProvisioningState values + */ + public static Collection values() { + return values(DomainProvisioningState.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainRegenerateKeyRequest.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainRegenerateKeyRequest.java new file mode 100644 index 000000000000..60b4aa2694aa --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainRegenerateKeyRequest.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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Domain regenerate share access key request. + */ +public class DomainRegenerateKeyRequest { + /** + * Key name to regenerate key1 or key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get key name to regenerate key1 or key2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set key name to regenerate key1 or key2. + * + * @param keyName the keyName value to set + * @return the DomainRegenerateKeyRequest object itself. + */ + public DomainRegenerateKeyRequest withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainSharedAccessKeys.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainSharedAccessKeys.java new file mode 100644 index 000000000000..a7afc1e2a4e4 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainSharedAccessKeys.java @@ -0,0 +1,30 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.DomainSharedAccessKeysInner; + +/** + * Type representing DomainSharedAccessKeys. + */ +public interface DomainSharedAccessKeys extends HasInner, HasManager { + /** + * @return the key1 value. + */ + String key1(); + + /** + * @return the key2 value. + */ + String key2(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopic.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopic.java new file mode 100644 index 000000000000..8105708641a8 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopic.java @@ -0,0 +1,93 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.DomainTopicInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; + +/** + * Type representing DomainTopic. + */ +public interface DomainTopic extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + DomainTopicProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DomainTopic definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDomain, DefinitionStages.WithCreate { + } + + /** + * Grouping of DomainTopic definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DomainTopic definition. + */ + interface Blank extends WithDomain { + } + + /** + * The stage of the domaintopic definition allowing to specify Domain. + */ + interface WithDomain { + /** + * Specifies resourceGroupName, domainName. + * @param resourceGroupName The name of the resource group within the user's subscription + * @param domainName Name of the domain + * @return the next definition stage + */ + WithCreate withExistingDomain(String resourceGroupName, String domainName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a DomainTopic update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of DomainTopic update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopicProvisioningState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopicProvisioningState.java new file mode 100644 index 000000000000..235290182213 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopicProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DomainTopicProvisioningState. + */ +public final class DomainTopicProvisioningState extends ExpandableStringEnum { + /** Static value Creating for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DomainTopicProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding DomainTopicProvisioningState + */ + @JsonCreator + public static DomainTopicProvisioningState fromString(String name) { + return fromString(name, DomainTopicProvisioningState.class); + } + + /** + * @return known DomainTopicProvisioningState values + */ + public static Collection values() { + return values(DomainTopicProvisioningState.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopics.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopics.java new file mode 100644 index 000000000000..fb46946ce50d --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainTopics.java @@ -0,0 +1,56 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.DomainTopicsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DomainTopics. + */ +public interface DomainTopics extends SupportsCreating, HasInner { + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String domainName, String domainTopicName); + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDomainAsync(final String resourceGroupName, final String domainName); + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String domainName, String domainTopicName); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainUpdateParameters.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainUpdateParameters.java new file mode 100644 index 000000000000..3725bb21f171 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/DomainUpdateParameters.java @@ -0,0 +1,106 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Properties of the Domain update. + */ +@JsonFlatten +public class DomainUpdateParameters { + /** + * Tags of the domains resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * This determines if traffic is allowed over public network. By default it + * is enabled. + * You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainUpdateParameterProperties.InboundIpRules" + * />. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * This can be used to restrict traffic from specific IPs instead of all + * IPs. Note: These are considered only if PublicNetworkAccess is enabled. + */ + @JsonProperty(value = "properties.inboundIpRules") + private List inboundIpRules; + + /** + * Get tags of the domains resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags of the domains resource. + * + * @param tags the tags value to set + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainUpdateParameterProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainUpdateParameterProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @param inboundIpRules the inboundIpRules value to set + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Domains.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Domains.java new file mode 100644 index 000000000000..3b95863ee45a --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Domains.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.DomainsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Domains. + */ +public interface Domains extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSharedAccessKeysAsync(String resourceGroupName, String domainName); + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param keyName Key name to regenerate key1 or key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String domainName, String keyName); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventDeliverySchema.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventDeliverySchema.java new file mode 100644 index 000000000000..59b50b846399 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventDeliverySchema.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.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventDeliverySchema. + */ +public final class EventDeliverySchema extends ExpandableStringEnum { + /** Static value EventGridSchema for EventDeliverySchema. */ + public static final EventDeliverySchema EVENT_GRID_SCHEMA = fromString("EventGridSchema"); + + /** Static value CustomInputSchema for EventDeliverySchema. */ + public static final EventDeliverySchema CUSTOM_INPUT_SCHEMA = fromString("CustomInputSchema"); + + /** Static value CloudEventSchemaV1_0 for EventDeliverySchema. */ + public static final EventDeliverySchema CLOUD_EVENT_SCHEMA_V1_0 = fromString("CloudEventSchemaV1_0"); + + /** + * Creates or finds a EventDeliverySchema from its string representation. + * @param name a name to look for + * @return the corresponding EventDeliverySchema + */ + @JsonCreator + public static EventDeliverySchema fromString(String name) { + return fromString(name, EventDeliverySchema.class); + } + + /** + * @return known EventDeliverySchema values + */ + public static Collection values() { + return values(EventDeliverySchema.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventHubEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventHubEventSubscriptionDestination.java new file mode 100644 index 000000000000..3111ceb19763 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventHubEventSubscriptionDestination.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the event hub destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = EventHubEventSubscriptionDestination.class) +@JsonTypeName("EventHub") +@JsonFlatten +public class EventHubEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource Id that represents the endpoint of an Event Hub + * destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the EventHubEventSubscriptionDestination object itself. + */ + public EventHubEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscription.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscription.java new file mode 100644 index 000000000000..6a9c53718b6f --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscription.java @@ -0,0 +1,302 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventSubscriptionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing EventSubscription. + */ +public interface EventSubscription extends HasInner, Indexable, Updatable, Refreshable, HasManager { + /** + * @return the deadLetterDestination value. + */ + DeadLetterDestination deadLetterDestination(); + + /** + * @return the destination value. + */ + EventSubscriptionDestination destination(); + + /** + * @return the eventDeliverySchema value. + */ + EventDeliverySchema eventDeliverySchema(); + + /** + * @return the expirationTimeUtc value. + */ + DateTime expirationTimeUtc(); + + /** + * @return the filter value. + */ + EventSubscriptionFilter filter(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the labels value. + */ + List labels(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + EventSubscriptionProvisioningState provisioningState(); + + /** + * @return the retryPolicy value. + */ + RetryPolicy retryPolicy(); + + /** + * @return the topic value. + */ + String topic(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the EventSubscription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** + * Grouping of EventSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EventSubscription definition. + */ + interface Blank extends WithScope { + } + + /** + * The stage of the eventsubscription definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic + * @return the next definition stage + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the eventsubscription definition allowing to specify DeadLetterDestination. + */ + interface WithDeadLetterDestination { + /** + * Specifies deadLetterDestination. + * @param deadLetterDestination The DeadLetter destination of the event subscription + * @return the next definition stage + */ + WithCreate withDeadLetterDestination(DeadLetterDestination deadLetterDestination); + } + + /** + * The stage of the eventsubscription definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Information about the destination where events have to be delivered for the event subscription + * @return the next definition stage + */ + WithCreate withDestination(EventSubscriptionDestination destination); + } + + /** + * The stage of the eventsubscription definition allowing to specify EventDeliverySchema. + */ + interface WithEventDeliverySchema { + /** + * Specifies eventDeliverySchema. + * @param eventDeliverySchema The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0' + * @return the next definition stage + */ + WithCreate withEventDeliverySchema(EventDeliverySchema eventDeliverySchema); + } + + /** + * The stage of the eventsubscription definition allowing to specify ExpirationTimeUtc. + */ + interface WithExpirationTimeUtc { + /** + * Specifies expirationTimeUtc. + * @param expirationTimeUtc Expiration time of the event subscription + * @return the next definition stage + */ + WithCreate withExpirationTimeUtc(DateTime expirationTimeUtc); + } + + /** + * The stage of the eventsubscription definition allowing to specify Filter. + */ + interface WithFilter { + /** + * Specifies filter. + * @param filter Information about the filter for the event subscription + * @return the next definition stage + */ + WithCreate withFilter(EventSubscriptionFilter filter); + } + + /** + * The stage of the eventsubscription definition allowing to specify Labels. + */ + interface WithLabels { + /** + * Specifies labels. + * @param labels List of user defined labels + * @return the next definition stage + */ + WithCreate withLabels(List labels); + } + + /** + * The stage of the eventsubscription definition allowing to specify RetryPolicy. + */ + interface WithRetryPolicy { + /** + * Specifies retryPolicy. + * @param retryPolicy The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events + * @return the next definition stage + */ + WithCreate withRetryPolicy(RetryPolicy retryPolicy); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDeadLetterDestination, DefinitionStages.WithDestination, DefinitionStages.WithEventDeliverySchema, DefinitionStages.WithExpirationTimeUtc, DefinitionStages.WithFilter, DefinitionStages.WithLabels, DefinitionStages.WithRetryPolicy { + } + } + /** + * The template for a EventSubscription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDeadLetterDestination, UpdateStages.WithDestination, UpdateStages.WithEventDeliverySchema, UpdateStages.WithExpirationTimeUtc, UpdateStages.WithFilter, UpdateStages.WithLabels, UpdateStages.WithRetryPolicy { + } + + /** + * Grouping of EventSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the eventsubscription update allowing to specify DeadLetterDestination. + */ + interface WithDeadLetterDestination { + /** + * Specifies deadLetterDestination. + * @param deadLetterDestination The DeadLetter destination of the event subscription + * @return the next update stage + */ + Update withDeadLetterDestination(DeadLetterDestination deadLetterDestination); + } + + /** + * The stage of the eventsubscription update allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Information about the destination where events have to be delivered for the event subscription + * @return the next update stage + */ + Update withDestination(EventSubscriptionDestination destination); + } + + /** + * The stage of the eventsubscription update allowing to specify EventDeliverySchema. + */ + interface WithEventDeliverySchema { + /** + * Specifies eventDeliverySchema. + * @param eventDeliverySchema The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0' + * @return the next update stage + */ + Update withEventDeliverySchema(EventDeliverySchema eventDeliverySchema); + } + + /** + * The stage of the eventsubscription update allowing to specify ExpirationTimeUtc. + */ + interface WithExpirationTimeUtc { + /** + * Specifies expirationTimeUtc. + * @param expirationTimeUtc Information about the expiration time for the event subscription + * @return the next update stage + */ + Update withExpirationTimeUtc(DateTime expirationTimeUtc); + } + + /** + * The stage of the eventsubscription update allowing to specify Filter. + */ + interface WithFilter { + /** + * Specifies filter. + * @param filter Information about the filter for the event subscription + * @return the next update stage + */ + Update withFilter(EventSubscriptionFilter filter); + } + + /** + * The stage of the eventsubscription update allowing to specify Labels. + */ + interface WithLabels { + /** + * Specifies labels. + * @param labels List of user defined labels + * @return the next update stage + */ + Update withLabels(List labels); + } + + /** + * The stage of the eventsubscription update allowing to specify RetryPolicy. + */ + interface WithRetryPolicy { + /** + * Specifies retryPolicy. + * @param retryPolicy The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events + * @return the next update stage + */ + Update withRetryPolicy(RetryPolicy retryPolicy); + } + + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionDestination.java new file mode 100644 index 000000000000..afe0bb353ddb --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionDestination.java @@ -0,0 +1,30 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = EventSubscriptionDestination.class) +@JsonTypeName("EventSubscriptionDestination") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "WebHook", value = WebHookEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "EventHub", value = EventHubEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "StorageQueue", value = StorageQueueEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "HybridConnection", value = HybridConnectionEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "ServiceBusQueue", value = ServiceBusQueueEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "ServiceBusTopic", value = ServiceBusTopicEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "AzureFunction", value = AzureFunctionEventSubscriptionDestination.class) +}) +public class EventSubscriptionDestination { +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionFilter.java new file mode 100644 index 000000000000..b9e860463b76 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionFilter.java @@ -0,0 +1,166 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter for the Event Subscription. + */ +public class EventSubscriptionFilter { + /** + * An optional string to filter events for an event subscription based on a + * resource path prefix. + * The format of this depends on the publisher of the events. + * Wildcard characters are not supported in this path. + */ + @JsonProperty(value = "subjectBeginsWith") + private String subjectBeginsWith; + + /** + * An optional string to filter events for an event subscription based on a + * resource path suffix. + * Wildcard characters are not supported in this path. + */ + @JsonProperty(value = "subjectEndsWith") + private String subjectEndsWith; + + /** + * A list of applicable event types that need to be part of the event + * subscription. If it is desired to subscribe to all default event types, + * set the IncludedEventTypes to null. + */ + @JsonProperty(value = "includedEventTypes") + private List includedEventTypes; + + /** + * Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the + * filter + * should be compared in a case sensitive manner. + */ + @JsonProperty(value = "isSubjectCaseSensitive") + private Boolean isSubjectCaseSensitive; + + /** + * An array of advanced filters that are used for filtering event + * subscriptions. + */ + @JsonProperty(value = "advancedFilters") + private List advancedFilters; + + /** + * Get an optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + * + * @return the subjectBeginsWith value + */ + public String subjectBeginsWith() { + return this.subjectBeginsWith; + } + + /** + * Set an optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + * + * @param subjectBeginsWith the subjectBeginsWith value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withSubjectBeginsWith(String subjectBeginsWith) { + this.subjectBeginsWith = subjectBeginsWith; + return this; + } + + /** + * Get an optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + * + * @return the subjectEndsWith value + */ + public String subjectEndsWith() { + return this.subjectEndsWith; + } + + /** + * Set an optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + * + * @param subjectEndsWith the subjectEndsWith value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withSubjectEndsWith(String subjectEndsWith) { + this.subjectEndsWith = subjectEndsWith; + return this; + } + + /** + * Get a list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. + * + * @return the includedEventTypes value + */ + public List includedEventTypes() { + return this.includedEventTypes; + } + + /** + * Set a list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. + * + * @param includedEventTypes the includedEventTypes value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withIncludedEventTypes(List includedEventTypes) { + this.includedEventTypes = includedEventTypes; + return this; + } + + /** + * Get specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. + * + * @return the isSubjectCaseSensitive value + */ + public Boolean isSubjectCaseSensitive() { + return this.isSubjectCaseSensitive; + } + + /** + * Set specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. + * + * @param isSubjectCaseSensitive the isSubjectCaseSensitive value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withIsSubjectCaseSensitive(Boolean isSubjectCaseSensitive) { + this.isSubjectCaseSensitive = isSubjectCaseSensitive; + return this; + } + + /** + * Get an array of advanced filters that are used for filtering event subscriptions. + * + * @return the advancedFilters value + */ + public List advancedFilters() { + return this.advancedFilters; + } + + /** + * Set an array of advanced filters that are used for filtering event subscriptions. + * + * @param advancedFilters the advancedFilters value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withAdvancedFilters(List advancedFilters) { + this.advancedFilters = advancedFilters; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionFullUrl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionFullUrl.java new file mode 100644 index 000000000000..c4ab571b77ef --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionFullUrl.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventSubscriptionFullUrlInner; + +/** + * Type representing EventSubscriptionFullUrl. + */ +public interface EventSubscriptionFullUrl extends HasInner, HasManager { + /** + * @return the endpointUrl value. + */ + String endpointUrl(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionProvisioningState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionProvisioningState.java new file mode 100644 index 000000000000..09e65c8f9964 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionProvisioningState.java @@ -0,0 +1,56 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventSubscriptionProvisioningState. + */ +public final class EventSubscriptionProvisioningState extends ExpandableStringEnum { + /** Static value Creating for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState FAILED = fromString("Failed"); + + /** Static value AwaitingManualAction for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState AWAITING_MANUAL_ACTION = fromString("AwaitingManualAction"); + + /** + * Creates or finds a EventSubscriptionProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding EventSubscriptionProvisioningState + */ + @JsonCreator + public static EventSubscriptionProvisioningState fromString(String name) { + return fromString(name, EventSubscriptionProvisioningState.class); + } + + /** + * @return known EventSubscriptionProvisioningState values + */ + public static Collection values() { + return values(EventSubscriptionProvisioningState.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionUpdateParameters.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionUpdateParameters.java new file mode 100644 index 000000000000..8ac2d46326b0 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptionUpdateParameters.java @@ -0,0 +1,204 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Event Subscription update. + */ +public class EventSubscriptionUpdateParameters { + /** + * Information about the destination where events have to be delivered for + * the event subscription. + */ + @JsonProperty(value = "destination") + private EventSubscriptionDestination destination; + + /** + * Information about the filter for the event subscription. + */ + @JsonProperty(value = "filter") + private EventSubscriptionFilter filter; + + /** + * List of user defined labels. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * Information about the expiration time for the event subscription. + */ + @JsonProperty(value = "expirationTimeUtc") + private DateTime expirationTimeUtc; + + /** + * The event delivery schema for the event subscription. Possible values + * include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0'. + */ + @JsonProperty(value = "eventDeliverySchema") + private EventDeliverySchema eventDeliverySchema; + + /** + * The retry policy for events. This can be used to configure maximum + * number of delivery attempts and time to live for events. + */ + @JsonProperty(value = "retryPolicy") + private RetryPolicy retryPolicy; + + /** + * The DeadLetter destination of the event subscription. + */ + @JsonProperty(value = "deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + + /** + * Get information about the destination where events have to be delivered for the event subscription. + * + * @return the destination value + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set information about the destination where events have to be delivered for the event subscription. + * + * @param destination the destination value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get information about the filter for the event subscription. + * + * @return the filter value + */ + public EventSubscriptionFilter filter() { + return this.filter; + } + + /** + * Set information about the filter for the event subscription. + * + * @param filter the filter value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withFilter(EventSubscriptionFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get list of user defined labels. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set list of user defined labels. + * + * @param labels the labels value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get information about the expiration time for the event subscription. + * + * @return the expirationTimeUtc value + */ + public DateTime expirationTimeUtc() { + return this.expirationTimeUtc; + } + + /** + * Set information about the expiration time for the event subscription. + * + * @param expirationTimeUtc the expirationTimeUtc value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withExpirationTimeUtc(DateTime expirationTimeUtc) { + this.expirationTimeUtc = expirationTimeUtc; + return this; + } + + /** + * Get the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0'. + * + * @return the eventDeliverySchema value + */ + public EventDeliverySchema eventDeliverySchema() { + return this.eventDeliverySchema; + } + + /** + * Set the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0'. + * + * @param eventDeliverySchema the eventDeliverySchema value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + this.eventDeliverySchema = eventDeliverySchema; + return this; + } + + /** + * Get the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @param retryPolicy the retryPolicy value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get the DeadLetter destination of the event subscription. + * + * @return the deadLetterDestination value + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the DeadLetter destination of the event subscription. + * + * @param deadLetterDestination the deadLetterDestination value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptions.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptions.java new file mode 100644 index 000000000000..8dab92e83e67 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventSubscriptions.java @@ -0,0 +1,146 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventSubscriptionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EventSubscriptions. + */ +public interface EventSubscriptions extends SupportsCreating, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String scope, String eventSubscriptionName); + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String scope, String eventSubscriptionName); + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFullUrlAsync(String scope, String eventSubscriptionName); + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName); + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName); + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalBySubscriptionAsync(final String location); + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalByResourceGroupAsync(final String resourceGroupName, final String location); + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName); + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName); + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName); + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventType.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventType.java new file mode 100644 index 000000000000..4ca93ffdc154 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/EventType.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventTypeInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; + +/** + * Type representing EventType. + */ +public interface EventType extends HasInner, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isInDefaultSet value. + */ + Boolean isInDefaultSet(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the schemaUrl value. + */ + String schemaUrl(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/HybridConnectionEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/HybridConnectionEventSubscriptionDestination.java new file mode 100644 index 000000000000..e72a65085ca8 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/HybridConnectionEventSubscriptionDestination.java @@ -0,0 +1,51 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the HybridConnection destination for an event + * subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = HybridConnectionEventSubscriptionDestination.class) +@JsonTypeName("HybridConnection") +@JsonFlatten +public class HybridConnectionEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource ID of an hybrid connection that is the destination of + * an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource ID of an hybrid connection that is the destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of an hybrid connection that is the destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the HybridConnectionEventSubscriptionDestination object itself. + */ + public HybridConnectionEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InboundIpRule.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InboundIpRule.java new file mode 100644 index 000000000000..54780e9e1acf --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InboundIpRule.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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The InboundIpRule model. + */ +public class InboundIpRule { + /** + * IP Address in CIDR notation e.g., 10.0.0.0/8. + */ + @JsonProperty(value = "ipMask") + private String ipMask; + + /** + * Action to perform based on the match or no match of the IpMask. Possible + * values include: 'Allow'. + */ + @JsonProperty(value = "action") + private IpActionType action; + + /** + * Get iP Address in CIDR notation e.g., 10.0.0.0/8. + * + * @return the ipMask value + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set iP Address in CIDR notation e.g., 10.0.0.0/8. + * + * @param ipMask the ipMask value to set + * @return the InboundIpRule object itself. + */ + public InboundIpRule withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get action to perform based on the match or no match of the IpMask. Possible values include: 'Allow'. + * + * @return the action value + */ + public IpActionType action() { + return this.action; + } + + /** + * Set action to perform based on the match or no match of the IpMask. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the InboundIpRule object itself. + */ + public InboundIpRule withAction(IpActionType action) { + this.action = action; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InputSchema.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InputSchema.java new file mode 100644 index 000000000000..7d936fbf2b76 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InputSchema.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.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InputSchema. + */ +public final class InputSchema extends ExpandableStringEnum { + /** Static value EventGridSchema for InputSchema. */ + public static final InputSchema EVENT_GRID_SCHEMA = fromString("EventGridSchema"); + + /** Static value CustomEventSchema for InputSchema. */ + public static final InputSchema CUSTOM_EVENT_SCHEMA = fromString("CustomEventSchema"); + + /** Static value CloudEventSchemaV1_0 for InputSchema. */ + public static final InputSchema CLOUD_EVENT_SCHEMA_V1_0 = fromString("CloudEventSchemaV1_0"); + + /** + * Creates or finds a InputSchema from its string representation. + * @param name a name to look for + * @return the corresponding InputSchema + */ + @JsonCreator + public static InputSchema fromString(String name) { + return fromString(name, InputSchema.class); + } + + /** + * @return known InputSchema values + */ + public static Collection values() { + return values(InputSchema.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InputSchemaMapping.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InputSchemaMapping.java new file mode 100644 index 000000000000..86812c2bf686 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/InputSchemaMapping.java @@ -0,0 +1,27 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * By default, Event Grid expects events to be in the Event Grid event schema. + * Specifying an input schema mapping enables publishing to Event Grid using a + * custom input schema. Currently, the only supported type of + * InputSchemaMapping is 'JsonInputSchemaMapping'. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputSchemaMappingType", defaultImpl = InputSchemaMapping.class) +@JsonTypeName("InputSchemaMapping") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Json", value = JsonInputSchemaMapping.class) +}) +public class InputSchemaMapping { +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/IpActionType.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/IpActionType.java new file mode 100644 index 000000000000..5fbe27a47a33 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/IpActionType.java @@ -0,0 +1,38 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpActionType. + */ +public final class IpActionType extends ExpandableStringEnum { + /** Static value Allow for IpActionType. */ + public static final IpActionType ALLOW = fromString("Allow"); + + /** + * Creates or finds a IpActionType from its string representation. + * @param name a name to look for + * @return the corresponding IpActionType + */ + @JsonCreator + public static IpActionType fromString(String name) { + return fromString(name, IpActionType.class); + } + + /** + * @return known IpActionType values + */ + public static Collection values() { + return values(IpActionType.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonField.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonField.java new file mode 100644 index 000000000000..4a9aa25b770c --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonField.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to express the source of an input schema mapping for a single + * target field in the Event Grid Event schema. This is currently used in the + * mappings for the 'id', 'topic' and 'eventtime' properties. This represents a + * field in the input event schema. + */ +public class JsonField { + /** + * Name of a field in the input event schema that's to be used as the + * source of a mapping. + */ + @JsonProperty(value = "sourceField") + private String sourceField; + + /** + * Get name of a field in the input event schema that's to be used as the source of a mapping. + * + * @return the sourceField value + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set name of a field in the input event schema that's to be used as the source of a mapping. + * + * @param sourceField the sourceField value to set + * @return the JsonField object itself. + */ + public JsonField withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonFieldWithDefault.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonFieldWithDefault.java new file mode 100644 index 000000000000..a13cbb957f50 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonFieldWithDefault.java @@ -0,0 +1,79 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to express the source of an input schema mapping for a single + * target field + * in the Event Grid Event schema. This is currently used in the mappings for + * the 'subject', + * 'eventtype' and 'dataversion' properties. This represents a field in the + * input event schema + * along with a default value to be used, and at least one of these two + * properties should be provided. + */ +public class JsonFieldWithDefault { + /** + * Name of a field in the input event schema that's to be used as the + * source of a mapping. + */ + @JsonProperty(value = "sourceField") + private String sourceField; + + /** + * The default value to be used for mapping when a SourceField is not + * provided or if there's no property with the specified name in the + * published JSON event payload. + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /** + * Get name of a field in the input event schema that's to be used as the source of a mapping. + * + * @return the sourceField value + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set name of a field in the input event schema that's to be used as the source of a mapping. + * + * @param sourceField the sourceField value to set + * @return the JsonFieldWithDefault object itself. + */ + public JsonFieldWithDefault withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + + /** + * Get the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload. + * + * @return the defaultValue value + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload. + * + * @param defaultValue the defaultValue value to set + * @return the JsonFieldWithDefault object itself. + */ + public JsonFieldWithDefault withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonInputSchemaMapping.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonInputSchemaMapping.java new file mode 100644 index 000000000000..c8595bc0b4fc --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/JsonInputSchemaMapping.java @@ -0,0 +1,185 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * This enables publishing to Event Grid using a custom input schema. This can + * be used to map properties from a custom input JSON schema to the Event Grid + * event schema. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputSchemaMappingType", defaultImpl = JsonInputSchemaMapping.class) +@JsonTypeName("Json") +@JsonFlatten +public class JsonInputSchemaMapping extends InputSchemaMapping { + /** + * The mapping information for the Id property of the Event Grid Event. + */ + @JsonProperty(value = "properties.id") + private JsonField id; + + /** + * The mapping information for the Topic property of the Event Grid Event. + */ + @JsonProperty(value = "properties.topic") + private JsonField topic; + + /** + * The mapping information for the EventTime property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.eventTime") + private JsonField eventTime; + + /** + * The mapping information for the EventType property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.eventType") + private JsonFieldWithDefault eventType; + + /** + * The mapping information for the Subject property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.subject") + private JsonFieldWithDefault subject; + + /** + * The mapping information for the DataVersion property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.dataVersion") + private JsonFieldWithDefault dataVersion; + + /** + * Get the mapping information for the Id property of the Event Grid Event. + * + * @return the id value + */ + public JsonField id() { + return this.id; + } + + /** + * Set the mapping information for the Id property of the Event Grid Event. + * + * @param id the id value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withId(JsonField id) { + this.id = id; + return this; + } + + /** + * Get the mapping information for the Topic property of the Event Grid Event. + * + * @return the topic value + */ + public JsonField topic() { + return this.topic; + } + + /** + * Set the mapping information for the Topic property of the Event Grid Event. + * + * @param topic the topic value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withTopic(JsonField topic) { + this.topic = topic; + return this; + } + + /** + * Get the mapping information for the EventTime property of the Event Grid Event. + * + * @return the eventTime value + */ + public JsonField eventTime() { + return this.eventTime; + } + + /** + * Set the mapping information for the EventTime property of the Event Grid Event. + * + * @param eventTime the eventTime value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withEventTime(JsonField eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get the mapping information for the EventType property of the Event Grid Event. + * + * @return the eventType value + */ + public JsonFieldWithDefault eventType() { + return this.eventType; + } + + /** + * Set the mapping information for the EventType property of the Event Grid Event. + * + * @param eventType the eventType value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withEventType(JsonFieldWithDefault eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the mapping information for the Subject property of the Event Grid Event. + * + * @return the subject value + */ + public JsonFieldWithDefault subject() { + return this.subject; + } + + /** + * Set the mapping information for the Subject property of the Event Grid Event. + * + * @param subject the subject value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withSubject(JsonFieldWithDefault subject) { + this.subject = subject; + return this; + } + + /** + * Get the mapping information for the DataVersion property of the Event Grid Event. + * + * @return the dataVersion value + */ + public JsonFieldWithDefault dataVersion() { + return this.dataVersion; + } + + /** + * Set the mapping information for the DataVersion property of the Event Grid Event. + * + * @param dataVersion the dataVersion value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withDataVersion(JsonFieldWithDefault dataVersion) { + this.dataVersion = dataVersion; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberGreaterThanAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberGreaterThanAdvancedFilter.java new file mode 100644 index 000000000000..17325f732f71 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberGreaterThanAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberGreaterThan Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = NumberGreaterThanAdvancedFilter.class) +@JsonTypeName("NumberGreaterThan") +public class NumberGreaterThanAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberGreaterThanAdvancedFilter object itself. + */ + public NumberGreaterThanAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberGreaterThanOrEqualsAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberGreaterThanOrEqualsAdvancedFilter.java new file mode 100644 index 000000000000..9fc86f1f56d2 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberGreaterThanOrEqualsAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberGreaterThanOrEquals Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = NumberGreaterThanOrEqualsAdvancedFilter.class) +@JsonTypeName("NumberGreaterThanOrEquals") +public class NumberGreaterThanOrEqualsAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberGreaterThanOrEqualsAdvancedFilter object itself. + */ + public NumberGreaterThanOrEqualsAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberInAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberInAdvancedFilter.java new file mode 100644 index 000000000000..97aa71eb1233 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = NumberInAdvancedFilter.class) +@JsonTypeName("NumberIn") +public class NumberInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the NumberInAdvancedFilter object itself. + */ + public NumberInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberLessThanAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberLessThanAdvancedFilter.java new file mode 100644 index 000000000000..72e1cf7c48aa --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberLessThanAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberLessThan Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = NumberLessThanAdvancedFilter.class) +@JsonTypeName("NumberLessThan") +public class NumberLessThanAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberLessThanAdvancedFilter object itself. + */ + public NumberLessThanAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberLessThanOrEqualsAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberLessThanOrEqualsAdvancedFilter.java new file mode 100644 index 000000000000..bd2069042629 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberLessThanOrEqualsAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberLessThanOrEquals Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = NumberLessThanOrEqualsAdvancedFilter.class) +@JsonTypeName("NumberLessThanOrEquals") +public class NumberLessThanOrEqualsAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberLessThanOrEqualsAdvancedFilter object itself. + */ + public NumberLessThanOrEqualsAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberNotInAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberNotInAdvancedFilter.java new file mode 100644 index 000000000000..9ddcde8b204f --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/NumberNotInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberNotIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = NumberNotInAdvancedFilter.class) +@JsonTypeName("NumberNotIn") +public class NumberNotInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the NumberNotInAdvancedFilter object itself. + */ + public NumberNotInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Operation.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Operation.java new file mode 100644 index 000000000000..66d89d7782ad --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Operation.java @@ -0,0 +1,40 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationInfo display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/OperationInfo.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/OperationInfo.java new file mode 100644 index 000000000000..5c3360d7de80 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/OperationInfo.java @@ -0,0 +1,121 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an operation. + */ +public class OperationInfo { + /** + * Name of the provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Name of the resource type. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the provider. + * + * @param provider the provider value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get name of the resource type. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set name of the resource type. + * + * @param resource the resource value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set name of the operation. + * + * @param operation the operation value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Operations.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Operations.java new file mode 100644 index 000000000000..98c195f497e0 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Operations.java @@ -0,0 +1,28 @@ +/** + * 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.eventgrid.v2020_06_01; + +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PersistedConnectionStatus.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PersistedConnectionStatus.java new file mode 100644 index 000000000000..97c264bb9376 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PersistedConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PersistedConnectionStatus. + */ +public final class PersistedConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PersistedConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PersistedConnectionStatus + */ + @JsonCreator + public static PersistedConnectionStatus fromString(String name) { + return fromString(name, PersistedConnectionStatus.class); + } + + /** + * @return known PersistedConnectionStatus values + */ + public static Collection values() { + return values(PersistedConnectionStatus.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpoint.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpoint.java new file mode 100644 index 000000000000..3864fa8f51cc --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpoint.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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * PrivateEndpoint information. + */ +public class PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ARM identifier for Private Endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ARM identifier for Private Endpoint. + * + * @param id the id value to set + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpointConnection.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpointConnection.java new file mode 100644 index 000000000000..8154ee7e6078 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpointConnection.java @@ -0,0 +1,118 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import java.util.List; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the groupIds value. + */ + List groupIds(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + ConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithGroupIds, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify GroupIds. + */ + interface WithGroupIds { + /** + * Specifies groupIds. + * @param groupIds GroupIds from the private link service resource + * @return the next update stage + */ + Update withGroupIds(List groupIds); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The Private Endpoint resource for this Connection + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Details about the state of the connection + * @return the next update stage + */ + Update withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ResourceProvisioningState provisioningState); + } + + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpointConnections.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpointConnections.java new file mode 100644 index 000000000000..ca8eef5e7a27 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateEndpointConnections.java @@ -0,0 +1,58 @@ +/** + * 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.eventgrid.v2020_06_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends HasInner { + /** + * Get a specific private endpoint connection. + * Get a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName); + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName); + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateLinkResource.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateLinkResource.java new file mode 100644 index 000000000000..367995dce2b8 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateLinkResource.java @@ -0,0 +1,56 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.PrivateLinkResourceInner; +import java.util.List; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the groupId value. + */ + String groupId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateLinkResources.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateLinkResources.java new file mode 100644 index 000000000000..53d823f65f32 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PrivateLinkResources.java @@ -0,0 +1,42 @@ +/** + * 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.eventgrid.v2020_06_01; + +import rx.Observable; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * Get a private link resource. + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateLinkResourceName The name of private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String parentType, String parentName, String privateLinkResourceName); + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PublicNetworkAccess.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PublicNetworkAccess.java new file mode 100644 index 000000000000..64990a81dd4a --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/PublicNetworkAccess.java @@ -0,0 +1,41 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicNetworkAccess. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * @param name a name to look for + * @return the corresponding PublicNetworkAccess + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * @return known PublicNetworkAccess values + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ResourceProvisioningState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ResourceProvisioningState.java new file mode 100644 index 000000000000..ccbe6e52ba8d --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ResourceProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceProvisioningState. + */ +public final class ResourceProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ResourceProvisioningState. */ + public static final ResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ResourceProvisioningState. */ + public static final ResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ResourceProvisioningState. */ + public static final ResourceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ResourceProvisioningState. */ + public static final ResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for ResourceProvisioningState. */ + public static final ResourceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for ResourceProvisioningState. */ + public static final ResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ResourceProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ResourceProvisioningState + */ + @JsonCreator + public static ResourceProvisioningState fromString(String name) { + return fromString(name, ResourceProvisioningState.class); + } + + /** + * @return known ResourceProvisioningState values + */ + public static Collection values() { + return values(ResourceProvisioningState.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ResourceRegionType.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ResourceRegionType.java new file mode 100644 index 000000000000..b4d9c96f0424 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ResourceRegionType.java @@ -0,0 +1,41 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceRegionType. + */ +public final class ResourceRegionType extends ExpandableStringEnum { + /** Static value RegionalResource for ResourceRegionType. */ + public static final ResourceRegionType REGIONAL_RESOURCE = fromString("RegionalResource"); + + /** Static value GlobalResource for ResourceRegionType. */ + public static final ResourceRegionType GLOBAL_RESOURCE = fromString("GlobalResource"); + + /** + * Creates or finds a ResourceRegionType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceRegionType + */ + @JsonCreator + public static ResourceRegionType fromString(String name) { + return fromString(name, ResourceRegionType.class); + } + + /** + * @return known ResourceRegionType values + */ + public static Collection values() { + return values(ResourceRegionType.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/RetryPolicy.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/RetryPolicy.java new file mode 100644 index 000000000000..29e2befde409 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/RetryPolicy.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the retry policy for an event subscription. + */ +public class RetryPolicy { + /** + * Maximum number of delivery retry attempts for events. + */ + @JsonProperty(value = "maxDeliveryAttempts") + private Integer maxDeliveryAttempts; + + /** + * Time To Live (in minutes) for events. + */ + @JsonProperty(value = "eventTimeToLiveInMinutes") + private Integer eventTimeToLiveInMinutes; + + /** + * Get maximum number of delivery retry attempts for events. + * + * @return the maxDeliveryAttempts value + */ + public Integer maxDeliveryAttempts() { + return this.maxDeliveryAttempts; + } + + /** + * Set maximum number of delivery retry attempts for events. + * + * @param maxDeliveryAttempts the maxDeliveryAttempts value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withMaxDeliveryAttempts(Integer maxDeliveryAttempts) { + this.maxDeliveryAttempts = maxDeliveryAttempts; + return this; + } + + /** + * Get time To Live (in minutes) for events. + * + * @return the eventTimeToLiveInMinutes value + */ + public Integer eventTimeToLiveInMinutes() { + return this.eventTimeToLiveInMinutes; + } + + /** + * Set time To Live (in minutes) for events. + * + * @param eventTimeToLiveInMinutes the eventTimeToLiveInMinutes value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withEventTimeToLiveInMinutes(Integer eventTimeToLiveInMinutes) { + this.eventTimeToLiveInMinutes = eventTimeToLiveInMinutes; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ServiceBusQueueEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ServiceBusQueueEventSubscriptionDestination.java new file mode 100644 index 000000000000..125ee17e240e --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ServiceBusQueueEventSubscriptionDestination.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the service bus destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = ServiceBusQueueEventSubscriptionDestination.class) +@JsonTypeName("ServiceBusQueue") +@JsonFlatten +public class ServiceBusQueueEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource Id that represents the endpoint of the Service Bus + * destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the ServiceBusQueueEventSubscriptionDestination object itself. + */ + public ServiceBusQueueEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ServiceBusTopicEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ServiceBusTopicEventSubscriptionDestination.java new file mode 100644 index 000000000000..4baea9ef901d --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/ServiceBusTopicEventSubscriptionDestination.java @@ -0,0 +1,51 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the service bus topic destination for an event + * subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = ServiceBusTopicEventSubscriptionDestination.class) +@JsonTypeName("ServiceBusTopic") +@JsonFlatten +public class ServiceBusTopicEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource Id that represents the endpoint of the Service Bus + * Topic destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the ServiceBusTopicEventSubscriptionDestination object itself. + */ + public ServiceBusTopicEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StorageBlobDeadLetterDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StorageBlobDeadLetterDestination.java new file mode 100644 index 000000000000..d77afcc99a43 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StorageBlobDeadLetterDestination.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the storage blob based dead letter destination. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = StorageBlobDeadLetterDestination.class) +@JsonTypeName("StorageBlob") +@JsonFlatten +public class StorageBlobDeadLetterDestination extends DeadLetterDestination { + /** + * The Azure Resource ID of the storage account that is the destination of + * the deadletter events. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The name of the Storage blob container that is the destination of the + * deadletter events. + */ + @JsonProperty(value = "properties.blobContainerName") + private String blobContainerName; + + /** + * Get the Azure Resource ID of the storage account that is the destination of the deadletter events. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of the storage account that is the destination of the deadletter events. + * + * @param resourceId the resourceId value to set + * @return the StorageBlobDeadLetterDestination object itself. + */ + public StorageBlobDeadLetterDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the name of the Storage blob container that is the destination of the deadletter events. + * + * @return the blobContainerName value + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Set the name of the Storage blob container that is the destination of the deadletter events. + * + * @param blobContainerName the blobContainerName value to set + * @return the StorageBlobDeadLetterDestination object itself. + */ + public StorageBlobDeadLetterDestination withBlobContainerName(String blobContainerName) { + this.blobContainerName = blobContainerName; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StorageQueueEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StorageQueueEventSubscriptionDestination.java new file mode 100644 index 000000000000..9a66887fb429 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StorageQueueEventSubscriptionDestination.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the storage queue destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = StorageQueueEventSubscriptionDestination.class) +@JsonTypeName("StorageQueue") +@JsonFlatten +public class StorageQueueEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource ID of the storage account that contains the queue + * that is the destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The name of the Storage queue under a storage account that is the + * destination of an event subscription. + */ + @JsonProperty(value = "properties.queueName") + private String queueName; + + /** + * Get the Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the name of the Storage queue under a storage account that is the destination of an event subscription. + * + * @return the queueName value + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the name of the Storage queue under a storage account that is the destination of an event subscription. + * + * @param queueName the queueName value to set + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringBeginsWithAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringBeginsWithAdvancedFilter.java new file mode 100644 index 000000000000..d558958730bb --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringBeginsWithAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringBeginsWith Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = StringBeginsWithAdvancedFilter.class) +@JsonTypeName("StringBeginsWith") +public class StringBeginsWithAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringBeginsWithAdvancedFilter object itself. + */ + public StringBeginsWithAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringContainsAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringContainsAdvancedFilter.java new file mode 100644 index 000000000000..0fedbc34bbb7 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringContainsAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringContains Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = StringContainsAdvancedFilter.class) +@JsonTypeName("StringContains") +public class StringContainsAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringContainsAdvancedFilter object itself. + */ + public StringContainsAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringEndsWithAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringEndsWithAdvancedFilter.java new file mode 100644 index 000000000000..3bec00652a52 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringEndsWithAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringEndsWith Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = StringEndsWithAdvancedFilter.class) +@JsonTypeName("StringEndsWith") +public class StringEndsWithAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringEndsWithAdvancedFilter object itself. + */ + public StringEndsWithAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringInAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringInAdvancedFilter.java new file mode 100644 index 000000000000..d0a9821ccf13 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = StringInAdvancedFilter.class) +@JsonTypeName("StringIn") +public class StringInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringInAdvancedFilter object itself. + */ + public StringInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringNotInAdvancedFilter.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringNotInAdvancedFilter.java new file mode 100644 index 000000000000..5e8b82702704 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/StringNotInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringNotIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType", defaultImpl = StringNotInAdvancedFilter.class) +@JsonTypeName("StringNotIn") +public class StringNotInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringNotInAdvancedFilter object itself. + */ + public StringNotInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Topic.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Topic.java new file mode 100644 index 000000000000..3a250b38a886 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Topic.java @@ -0,0 +1,196 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.TopicInner; + +/** + * Type representing Topic. + */ +public interface Topic extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the inboundIpRules value. + */ + List inboundIpRules(); + + /** + * @return the inputSchema value. + */ + InputSchema inputSchema(); + + /** + * @return the inputSchemaMapping value. + */ + InputSchemaMapping inputSchemaMapping(); + + /** + * @return the metricResourceId value. + */ + String metricResourceId(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + TopicProvisioningState provisioningState(); + + /** + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * The entirety of the Topic definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Topic definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Topic definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Topic definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the topic definition allowing to specify InboundIpRules. + */ + interface WithInboundIpRules { + /** + * Specifies inboundIpRules. + * @param inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled + * @return the next definition stage + */ + WithCreate withInboundIpRules(List inboundIpRules); + } + + /** + * The stage of the topic definition allowing to specify InputSchema. + */ + interface WithInputSchema { + /** + * Specifies inputSchema. + * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0' + * @return the next definition stage + */ + WithCreate withInputSchema(InputSchema inputSchema); + } + + /** + * The stage of the topic definition allowing to specify InputSchemaMapping. + */ + interface WithInputSchemaMapping { + /** + * Specifies inputSchemaMapping. + * @param inputSchemaMapping This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema + * @return the next definition stage + */ + WithCreate withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); + } + + /** + * The stage of the topic definition allowing to specify PrivateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies privateEndpointConnections. + * @param privateEndpointConnections the privateEndpointConnections parameter value + * @return the next definition stage + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + + /** + * The stage of the topic definition allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithInboundIpRules, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithPrivateEndpointConnections, DefinitionStages.WithPublicNetworkAccess { + } + } + /** + * The template for a Topic update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithInboundIpRules, UpdateStages.WithPublicNetworkAccess { + } + + /** + * Grouping of Topic update stages. + */ + interface UpdateStages { + /** + * The stage of the topic update allowing to specify InboundIpRules. + */ + interface WithInboundIpRules { + /** + * Specifies inboundIpRules. + * @param inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled + * @return the next update stage + */ + Update withInboundIpRules(List inboundIpRules); + } + + /** + * The stage of the topic update allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicUpdateParameterProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicProvisioningState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicProvisioningState.java new file mode 100644 index 000000000000..6e8f52335a69 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TopicProvisioningState. + */ +public final class TopicProvisioningState extends ExpandableStringEnum { + /** Static value Creating for TopicProvisioningState. */ + public static final TopicProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for TopicProvisioningState. */ + public static final TopicProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for TopicProvisioningState. */ + public static final TopicProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for TopicProvisioningState. */ + public static final TopicProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for TopicProvisioningState. */ + public static final TopicProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for TopicProvisioningState. */ + public static final TopicProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a TopicProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding TopicProvisioningState + */ + @JsonCreator + public static TopicProvisioningState fromString(String name) { + return fromString(name, TopicProvisioningState.class); + } + + /** + * @return known TopicProvisioningState values + */ + public static Collection values() { + return values(TopicProvisioningState.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicRegenerateKeyRequest.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicRegenerateKeyRequest.java new file mode 100644 index 000000000000..9b3461b2ea32 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicRegenerateKeyRequest.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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topic regenerate share access key request. + */ +public class TopicRegenerateKeyRequest { + /** + * Key name to regenerate key1 or key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get key name to regenerate key1 or key2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set key name to regenerate key1 or key2. + * + * @param keyName the keyName value to set + * @return the TopicRegenerateKeyRequest object itself. + */ + public TopicRegenerateKeyRequest withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicSharedAccessKeys.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicSharedAccessKeys.java new file mode 100644 index 000000000000..d2bd5c766bab --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicSharedAccessKeys.java @@ -0,0 +1,30 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.TopicSharedAccessKeysInner; + +/** + * Type representing TopicSharedAccessKeys. + */ +public interface TopicSharedAccessKeys extends HasInner, HasManager { + /** + * @return the key1 value. + */ + String key1(); + + /** + * @return the key2 value. + */ + String key2(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypeInfo.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypeInfo.java new file mode 100644 index 000000000000..67f4a66ac4f6 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypeInfo.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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.TopicTypeInfoInner; +import java.util.List; + +/** + * Type representing TopicTypeInfo. + */ +public interface TopicTypeInfo extends HasInner, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provider value. + */ + String provider(); + + /** + * @return the provisioningState value. + */ + TopicTypeProvisioningState provisioningState(); + + /** + * @return the resourceRegionType value. + */ + ResourceRegionType resourceRegionType(); + + /** + * @return the sourceResourceFormat value. + */ + String sourceResourceFormat(); + + /** + * @return the supportedLocations value. + */ + List supportedLocations(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypeProvisioningState.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypeProvisioningState.java new file mode 100644 index 000000000000..06e29fba18e6 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypeProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TopicTypeProvisioningState. + */ +public final class TopicTypeProvisioningState extends ExpandableStringEnum { + /** Static value Creating for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a TopicTypeProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding TopicTypeProvisioningState + */ + @JsonCreator + public static TopicTypeProvisioningState fromString(String name) { + return fromString(name, TopicTypeProvisioningState.class); + } + + /** + * @return known TopicTypeProvisioningState values + */ + public static Collection values() { + return values(TopicTypeProvisioningState.class); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypes.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypes.java new file mode 100644 index 000000000000..d41146439720 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicTypes.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01; + +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.TopicTypesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TopicTypes. + */ +public interface TopicTypes extends HasInner { + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventTypesAsync(String topicTypeName); + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String topicTypeName); + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicUpdateParameters.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicUpdateParameters.java new file mode 100644 index 000000000000..2b59787c5fcc --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/TopicUpdateParameters.java @@ -0,0 +1,106 @@ +/** + * 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.eventgrid.v2020_06_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Properties of the Topic update. + */ +@JsonFlatten +public class TopicUpdateParameters { + /** + * Tags of the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * This determines if traffic is allowed over public network. By default it + * is enabled. + * You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicUpdateParameterProperties.InboundIpRules" + * />. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * This can be used to restrict traffic from specific IPs instead of all + * IPs. Note: These are considered only if PublicNetworkAccess is enabled. + */ + @JsonProperty(value = "properties.inboundIpRules") + private List inboundIpRules; + + /** + * Get tags of the resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags of the resource. + * + * @param tags the tags value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicUpdateParameterProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicUpdateParameterProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @param inboundIpRules the inboundIpRules value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Topics.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Topics.java new file mode 100644 index 000000000000..088a0da9202a --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/Topics.java @@ -0,0 +1,61 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.eventgrid.v2020_06_01.implementation.TopicsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Topics. + */ +public interface Topics extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSharedAccessKeysAsync(String resourceGroupName, String topicName); + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String topicName, String keyName); + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the topic type. + * @param resourceName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName); + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/WebHookEventSubscriptionDestination.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/WebHookEventSubscriptionDestination.java new file mode 100644 index 000000000000..c84d99bfe509 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/WebHookEventSubscriptionDestination.java @@ -0,0 +1,172 @@ +/** + * 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.eventgrid.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the webhook destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType", defaultImpl = WebHookEventSubscriptionDestination.class) +@JsonTypeName("WebHook") +@JsonFlatten +public class WebHookEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The URL that represents the endpoint of the destination of an event + * subscription. + */ + @JsonProperty(value = "properties.endpointUrl") + private String endpointUrl; + + /** + * The base URL that represents the endpoint of the destination of an event + * subscription. + */ + @JsonProperty(value = "properties.endpointBaseUrl", access = JsonProperty.Access.WRITE_ONLY) + private String endpointBaseUrl; + + /** + * Maximum number of events per batch. + */ + @JsonProperty(value = "properties.maxEventsPerBatch") + private Integer maxEventsPerBatch; + + /** + * Preferred batch size in Kilobytes. + */ + @JsonProperty(value = "properties.preferredBatchSizeInKilobytes") + private Integer preferredBatchSizeInKilobytes; + + /** + * The Azure Active Directory Tenant ID to get the access token that will + * be included as the bearer token in delivery requests. + */ + @JsonProperty(value = "properties.azureActiveDirectoryTenantId") + private String azureActiveDirectoryTenantId; + + /** + * The Azure Active Directory Application ID or URI to get the access token + * that will be included as the bearer token in delivery requests. + */ + @JsonProperty(value = "properties.azureActiveDirectoryApplicationIdOrUri") + private String azureActiveDirectoryApplicationIdOrUri; + + /** + * Get the URL that represents the endpoint of the destination of an event subscription. + * + * @return the endpointUrl value + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the URL that represents the endpoint of the destination of an event subscription. + * + * @param endpointUrl the endpointUrl value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Get the base URL that represents the endpoint of the destination of an event subscription. + * + * @return the endpointBaseUrl value + */ + public String endpointBaseUrl() { + return this.endpointBaseUrl; + } + + /** + * Get maximum number of events per batch. + * + * @return the maxEventsPerBatch value + */ + public Integer maxEventsPerBatch() { + return this.maxEventsPerBatch; + } + + /** + * Set maximum number of events per batch. + * + * @param maxEventsPerBatch the maxEventsPerBatch value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withMaxEventsPerBatch(Integer maxEventsPerBatch) { + this.maxEventsPerBatch = maxEventsPerBatch; + return this; + } + + /** + * Get preferred batch size in Kilobytes. + * + * @return the preferredBatchSizeInKilobytes value + */ + public Integer preferredBatchSizeInKilobytes() { + return this.preferredBatchSizeInKilobytes; + } + + /** + * Set preferred batch size in Kilobytes. + * + * @param preferredBatchSizeInKilobytes the preferredBatchSizeInKilobytes value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withPreferredBatchSizeInKilobytes(Integer preferredBatchSizeInKilobytes) { + this.preferredBatchSizeInKilobytes = preferredBatchSizeInKilobytes; + return this; + } + + /** + * Get the Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + * + * @return the azureActiveDirectoryTenantId value + */ + public String azureActiveDirectoryTenantId() { + return this.azureActiveDirectoryTenantId; + } + + /** + * Set the Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + * + * @param azureActiveDirectoryTenantId the azureActiveDirectoryTenantId value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withAzureActiveDirectoryTenantId(String azureActiveDirectoryTenantId) { + this.azureActiveDirectoryTenantId = azureActiveDirectoryTenantId; + return this; + } + + /** + * Get the Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests. + * + * @return the azureActiveDirectoryApplicationIdOrUri value + */ + public String azureActiveDirectoryApplicationIdOrUri() { + return this.azureActiveDirectoryApplicationIdOrUri; + } + + /** + * Set the Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests. + * + * @param azureActiveDirectoryApplicationIdOrUri the azureActiveDirectoryApplicationIdOrUri value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withAzureActiveDirectoryApplicationIdOrUri(String azureActiveDirectoryApplicationIdOrUri) { + this.azureActiveDirectoryApplicationIdOrUri = azureActiveDirectoryApplicationIdOrUri; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainImpl.java new file mode 100644 index 000000000000..5459fd9128cc --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainImpl.java @@ -0,0 +1,159 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Domain; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchema; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchemaMapping; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PublicNetworkAccess; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InboundIpRule; +import java.util.ArrayList; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnection; +import rx.functions.Func1; + +class DomainImpl extends GroupableResourceCoreImpl implements Domain, Domain.Definition, Domain.Update { + private DomainUpdateParameters updateParameter; + DomainImpl(String name, DomainInner inner, EventGridManager manager) { + super(name, inner, manager); + this.updateParameter = new DomainUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + DomainsInner client = this.manager().inner().domains(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public DomainInner call(DomainInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DomainsInner client = this.manager().inner().domains(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DomainInner call(DomainInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DomainsInner client = this.manager().inner().domains(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new DomainUpdateParameters(); + } + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public List inboundIpRules() { + return this.inner().inboundIpRules(); + } + + @Override + public InputSchema inputSchema() { + return this.inner().inputSchema(); + } + + @Override + public InputSchemaMapping inputSchemaMapping() { + return this.inner().inputSchemaMapping(); + } + + @Override + public String metricResourceId() { + return this.inner().metricResourceId(); + } + + @Override + public List privateEndpointConnections() { + List lst = new ArrayList(); + if (this.inner().privateEndpointConnections() != null) { + for (PrivateEndpointConnectionInner inner : this.inner().privateEndpointConnections()) { + lst.add( new PrivateEndpointConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public DomainProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.inner().publicNetworkAccess(); + } + + @Override + public DomainImpl withInputSchema(InputSchema inputSchema) { + this.inner().withInputSchema(inputSchema); + return this; + } + + @Override + public DomainImpl withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inner().withInputSchemaMapping(inputSchemaMapping); + return this; + } + + @Override + public DomainImpl withPrivateEndpointConnections(List privateEndpointConnections) { + this.inner().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + @Override + public DomainImpl withInboundIpRules(List inboundIpRules) { + if (isInCreateMode()) { + this.inner().withInboundIpRules(inboundIpRules); + } else { + this.updateParameter.withInboundIpRules(inboundIpRules); + } + return this; + } + + @Override + public DomainImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.inner().withPublicNetworkAccess(publicNetworkAccess); + } else { + this.updateParameter.withPublicNetworkAccess(publicNetworkAccess); + } + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainInner.java new file mode 100644 index 000000000000..f72b50cac646 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainInner.java @@ -0,0 +1,212 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchema; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchemaMapping; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PublicNetworkAccess; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InboundIpRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * EventGrid Domain. + */ +@JsonFlatten +public class DomainInner extends Resource { + /** + * List of private endpoint connections. + */ + @JsonProperty(value = "properties.privateEndpointConnections") + private List privateEndpointConnections; + + /** + * Provisioning state of the domain. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DomainProvisioningState provisioningState; + + /** + * Endpoint for the domain. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * This determines the format that Event Grid should expect for incoming + * events published to the domain. Possible values include: + * 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. + */ + @JsonProperty(value = "properties.inputSchema") + private InputSchema inputSchema; + + /** + * Information about the InputSchemaMapping which specified the info about + * mapping event payload. + */ + @JsonProperty(value = "properties.inputSchemaMapping") + private InputSchemaMapping inputSchemaMapping; + + /** + * Metric resource id for the domain. + */ + @JsonProperty(value = "properties.metricResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String metricResourceId; + + /** + * This determines if traffic is allowed over public network. By default it + * is enabled. + * You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules" + * />. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * This can be used to restrict traffic from specific IPs instead of all + * IPs. Note: These are considered only if PublicNetworkAccess is enabled. + */ + @JsonProperty(value = "properties.inboundIpRules") + private List inboundIpRules; + + /** + * Get list of private endpoint connections. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set list of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set + * @return the DomainInner object itself. + */ + public DomainInner withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get provisioning state of the domain. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public DomainProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get endpoint for the domain. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get this determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. + * + * @return the inputSchema value + */ + public InputSchema inputSchema() { + return this.inputSchema; + } + + /** + * Set this determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. + * + * @param inputSchema the inputSchema value to set + * @return the DomainInner object itself. + */ + public DomainInner withInputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + return this; + } + + /** + * Get information about the InputSchemaMapping which specified the info about mapping event payload. + * + * @return the inputSchemaMapping value + */ + public InputSchemaMapping inputSchemaMapping() { + return this.inputSchemaMapping; + } + + /** + * Set information about the InputSchemaMapping which specified the info about mapping event payload. + * + * @param inputSchemaMapping the inputSchemaMapping value to set + * @return the DomainInner object itself. + */ + public DomainInner withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inputSchemaMapping = inputSchemaMapping; + return this; + } + + /** + * Get metric resource id for the domain. + * + * @return the metricResourceId value + */ + public String metricResourceId() { + return this.metricResourceId; + } + + /** + * Get this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the DomainInner object itself. + */ + public DomainInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @param inboundIpRules the inboundIpRules value to set + * @return the DomainInner object itself. + */ + public DomainInner withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainSharedAccessKeysImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainSharedAccessKeysImpl.java new file mode 100644 index 000000000000..d68eb7c84463 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainSharedAccessKeysImpl.java @@ -0,0 +1,36 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainSharedAccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DomainSharedAccessKeysImpl extends WrapperImpl implements DomainSharedAccessKeys { + private final EventGridManager manager; + DomainSharedAccessKeysImpl(DomainSharedAccessKeysInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String key1() { + return this.inner().key1(); + } + + @Override + public String key2() { + return this.inner().key2(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainSharedAccessKeysInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainSharedAccessKeysInner.java new file mode 100644 index 000000000000..28a80817652b --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainSharedAccessKeysInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shared access keys of the Domain. + */ +public class DomainSharedAccessKeysInner { + /** + * Shared access key1 for the domain. + */ + @JsonProperty(value = "key1") + private String key1; + + /** + * Shared access key2 for the domain. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get shared access key1 for the domain. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set shared access key1 for the domain. + * + * @param key1 the key1 value to set + * @return the DomainSharedAccessKeysInner object itself. + */ + public DomainSharedAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get shared access key2 for the domain. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set shared access key2 for the domain. + * + * @param key2 the key2 value to set + * @return the DomainSharedAccessKeysInner object itself. + */ + public DomainSharedAccessKeysInner withKey2(String key2) { + this.key2 = key2; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicImpl.java new file mode 100644 index 000000000000..107ce7079dfe --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicImpl.java @@ -0,0 +1,100 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopic; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopicProvisioningState; + +class DomainTopicImpl extends CreatableUpdatableImpl implements DomainTopic, DomainTopic.Definition, DomainTopic.Update { + private final EventGridManager manager; + private String resourceGroupName; + private String domainName; + private String domainTopicName; + + DomainTopicImpl(String name, EventGridManager manager) { + super(name, new DomainTopicInner()); + this.manager = manager; + // Set resource name + this.domainTopicName = name; + // + } + + DomainTopicImpl(DomainTopicInner inner, EventGridManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.domainTopicName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.domainName = IdParsingUtils.getValueFromIdByName(inner.id(), "domains"); + this.domainTopicName = IdParsingUtils.getValueFromIdByName(inner.id(), "topics"); + // + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DomainTopicsInner client = this.manager().inner().domainTopics(); + return client.createOrUpdateAsync(this.resourceGroupName, this.domainName, this.domainTopicName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DomainTopicsInner client = this.manager().inner().domainTopics(); + return client.createOrUpdateAsync(this.resourceGroupName, this.domainName, this.domainTopicName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DomainTopicsInner client = this.manager().inner().domainTopics(); + return client.getAsync(this.resourceGroupName, this.domainName, this.domainTopicName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DomainTopicProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DomainTopicImpl withExistingDomain(String resourceGroupName, String domainName) { + this.resourceGroupName = resourceGroupName; + this.domainName = domainName; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicInner.java new file mode 100644 index 000000000000..c394e09aba7a --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopicProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Domain Topic. + */ +@JsonFlatten +public class DomainTopicInner extends ProxyResource { + /** + * Provisioning state of the domain topic. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private DomainTopicProvisioningState provisioningState; + + /** + * Get provisioning state of the domain topic. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public DomainTopicProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the domain topic. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the DomainTopicInner object itself. + */ + public DomainTopicInner withProvisioningState(DomainTopicProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicsImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicsImpl.java new file mode 100644 index 000000000000..51f43a33bf72 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicsImpl.java @@ -0,0 +1,85 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopics; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopic; + +class DomainTopicsImpl extends WrapperImpl implements DomainTopics { + private final EventGridManager manager; + + DomainTopicsImpl(EventGridManager manager) { + super(manager.inner().domainTopics()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public DomainTopicImpl define(String name) { + return wrapModel(name); + } + + private DomainTopicImpl wrapModel(DomainTopicInner inner) { + return new DomainTopicImpl(inner, manager()); + } + + private DomainTopicImpl wrapModel(String name) { + return new DomainTopicImpl(name, this.manager()); + } + + @Override + public Observable listByDomainAsync(final String resourceGroupName, final String domainName) { + DomainTopicsInner client = this.inner(); + return client.listByDomainAsync(resourceGroupName, domainName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DomainTopic call(DomainTopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String domainName, String domainTopicName) { + DomainTopicsInner client = this.inner(); + return client.getAsync(resourceGroupName, domainName, domainTopicName) + .flatMap(new Func1>() { + @Override + public Observable call(DomainTopicInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DomainTopic)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String domainName, String domainTopicName) { + DomainTopicsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, domainName, domainTopicName).toCompletable(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicsInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicsInner.java new file mode 100644 index 000000000000..af23f3f5f0eb --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainTopicsInner.java @@ -0,0 +1,919 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +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.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DomainTopics. + */ +public class DomainTopicsInner { + /** The Retrofit service to perform REST calls. */ + private DomainTopicsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of DomainTopicsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DomainTopicsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(DomainTopicsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DomainTopics to be + * used by Retrofit to perform actually REST calls. + */ + interface DomainTopicsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopics get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @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.eventgrid.v2020_06_01.DomainTopics createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @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.eventgrid.v2020_06_01.DomainTopics beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @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.eventgrid.v2020_06_01.DomainTopics delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @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.eventgrid.v2020_06_01.DomainTopics beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @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.eventgrid.v2020_06_01.DomainTopics listByDomain" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics") + Observable> listByDomain(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.DomainTopics listByDomainNext" }) + @GET + Observable> listByDomainNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the topic. + * @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 DomainTopicInner object if successful. + */ + public DomainTopicInner get(String resourceGroupName, String domainName, String domainTopicName) { + return getWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().single().body(); + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the topic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable getAsync(String resourceGroupName, String domainName, String domainTopicName) { + return getWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, DomainTopicInner>() { + @Override + public DomainTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @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 DomainTopicInner object if successful. + */ + public DomainTopicInner createOrUpdate(String resourceGroupName, String domainName, String domainTopicName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().last().body(); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @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 createOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, DomainTopicInner>() { + @Override + public DomainTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @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 DomainTopicInner object if successful. + */ + public DomainTopicInner beginCreateOrUpdate(String resourceGroupName, String domainName, String domainTopicName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().single().body(); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, DomainTopicInner>() { + @Override + public DomainTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName 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.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @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 + */ + public void delete(String resourceGroupName, String domainName, String domainTopicName) { + deleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().last().body(); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String domainName, String domainTopicName) { + return deleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @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 + */ + public void beginDelete(String resourceGroupName, String domainName, String domainTopicName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().single().body(); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String domainName, String domainTopicName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainTopicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @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 PagedList<DomainTopicInner> object if successful. + */ + public PagedList listByDomain(final String resourceGroupName, final String domainName) { + ServiceResponse> response = listByDomainSinglePageAsync(resourceGroupName, domainName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainAsync(final String resourceGroupName, final String domainName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainSinglePageAsync(resourceGroupName, domainName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable> listByDomainAsync(final String resourceGroupName, final String domainName) { + return listByDomainWithServiceResponseAsync(resourceGroupName, domainName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable>> listByDomainWithServiceResponseAsync(final String resourceGroupName, final String domainName) { + return listByDomainSinglePageAsync(resourceGroupName, domainName) + .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(listByDomainNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainSinglePageAsync(final String resourceGroupName, final String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByDomain(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<DomainTopicInner> object if successful. + */ + public PagedList listByDomain(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + ServiceResponse> response = listByDomainSinglePageAsync(resourceGroupName, domainName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listByDomainAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainSinglePageAsync(resourceGroupName, domainName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable> listByDomainAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + return listByDomainWithServiceResponseAsync(resourceGroupName, domainName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable>> listByDomainWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + return listByDomainSinglePageAsync(resourceGroupName, domainName, filter, top) + .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(listByDomainNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param domainName Domain name. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainSinglePageAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName 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.listByDomain(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<DomainTopicInner> object if successful. + */ + public PagedList listByDomainNext(final String nextPageLink) { + ServiceResponse> response = listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @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> listByDomainNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @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<DomainTopicInner> object + */ + public Observable> listByDomainNextAsync(final String nextPageLink) { + return listByDomainNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @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<DomainTopicInner> object + */ + public Observable>> listByDomainNextWithServiceResponseAsync(final String nextPageLink) { + return listByDomainNextSinglePageAsync(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(listByDomainNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainNextSinglePageAsync(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.listByDomainNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainsImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainsImpl.java new file mode 100644 index 000000000000..0a9aa568d316 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainsImpl.java @@ -0,0 +1,163 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Domains; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Domain; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainSharedAccessKeys; + +class DomainsImpl extends GroupableResourcesCoreImpl implements Domains { + protected DomainsImpl(EventGridManager manager) { + super(manager.inner().domains(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DomainsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DomainsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DomainsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DomainsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Domain call(DomainInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DomainsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DomainsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Domain call(DomainInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DomainImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listSharedAccessKeysAsync(String resourceGroupName, String domainName) { + DomainsInner client = this.inner(); + return client.listSharedAccessKeysAsync(resourceGroupName, domainName) + .map(new Func1() { + @Override + public DomainSharedAccessKeys call(DomainSharedAccessKeysInner inner) { + return new DomainSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String domainName, String keyName) { + DomainsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, domainName, keyName) + .map(new Func1() { + @Override + public DomainSharedAccessKeys call(DomainSharedAccessKeysInner inner) { + return new DomainSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + protected DomainImpl wrapModel(DomainInner inner) { + return new DomainImpl(inner.name(), inner, manager()); + } + + @Override + protected DomainImpl wrapModel(String name) { + return new DomainImpl(name, new DomainInner(), this.manager()); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainsInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainsInner.java new file mode 100644 index 000000000000..2fb643509311 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/DomainsInner.java @@ -0,0 +1,1631 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainRegenerateKeyRequest; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Domains. + */ +public class DomainsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DomainsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of DomainsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DomainsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(DomainsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Domains to be + * used by Retrofit to perform actually REST calls. + */ + interface DomainsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.Domains getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @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.eventgrid.v2020_06_01.Domains createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainInner domainInfo, @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.eventgrid.v2020_06_01.Domains beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainInner domainInfo, @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.eventgrid.v2020_06_01.Domains delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @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.eventgrid.v2020_06_01.Domains beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @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.eventgrid.v2020_06_01.Domains update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainUpdateParameters domainUpdateParameters, @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.eventgrid.v2020_06_01.Domains beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainUpdateParameters domainUpdateParameters, @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.eventgrid.v2020_06_01.Domains list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.Domains listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.Domains listSharedAccessKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys") + Observable> listSharedAccessKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @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.eventgrid.v2020_06_01.Domains regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DomainRegenerateKeyRequest regenerateKeyRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.Domains listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.Domains listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @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 DomainInner object if successful. + */ + public DomainInner getByResourceGroup(String resourceGroupName, String domainName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String domainName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @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 DomainInner object if successful. + */ + public DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domainInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).toBlocking().last().body(); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @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 createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo), serviceCallback); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainInfo == null) { + throw new IllegalArgumentException("Parameter domainInfo 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(domainInfo); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @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 DomainInner object if successful. + */ + public DomainInner beginCreateOrUpdate(String resourceGroupName, String domainName, DomainInner domainInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).toBlocking().single().body(); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo), serviceCallback); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainInfo Domain information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainInfo == null) { + throw new IllegalArgumentException("Parameter domainInfo 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(domainInfo); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @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 + */ + public void delete(String resourceGroupName, String domainName) { + deleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().last().body(); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String domainName) { + return deleteWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @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 + */ + public void beginDelete(String resourceGroupName, String domainName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String domainName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @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 DomainInner object if successful. + */ + public DomainInner update(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).toBlocking().last().body(); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters), serviceCallback); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainUpdateParameters == null) { + throw new IllegalArgumentException("Parameter domainUpdateParameters 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(domainUpdateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, domainName, domainUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @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 DomainInner object if successful. + */ + public DomainInner beginUpdate(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).toBlocking().single().body(); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters), serviceCallback); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainUpdateParameters == null) { + throw new IllegalArgumentException("Parameter domainUpdateParameters 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(domainUpdateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @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 PagedList<DomainInner> 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(); + } + }; + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> 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)); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, 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); + } + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<DomainInner> object if successful. + */ + public PagedList list(final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listAsync(final String filter, final Integer top) { + return listWithServiceResponseAsync(filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top) { + return listSinglePageAsync(filter, top) + .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)); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 PagedList<DomainInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<DomainInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @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 DomainSharedAccessKeysInner object if successful. + */ + public DomainSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String domainName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @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 listSharedAccessKeysAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable listSharedAccessKeysAsync(String resourceGroupName, String domainName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainSharedAccessKeysInner>() { + @Override + public DomainSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable> listSharedAccessKeysWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName 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.listSharedAccessKeys(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedAccessKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSharedAccessKeysDelegate(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); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param keyName Key name to regenerate key1 or key2. + * @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 DomainSharedAccessKeysInner object if successful. + */ + public DomainSharedAccessKeysInner regenerateKey(String resourceGroupName, String domainName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName).toBlocking().single().body(); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param keyName Key name to regenerate key1 or key2. + * @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 regenerateKeyAsync(String resourceGroupName, String domainName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName), serviceCallback); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param keyName Key name to regenerate key1 or key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String domainName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName).map(new Func1, DomainSharedAccessKeysInner>() { + @Override + public DomainSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain. + * @param keyName Key name to regenerate key1 or key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String domainName, String keyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + DomainRegenerateKeyRequest regenerateKeyRequest = new DomainRegenerateKeyRequest(); + regenerateKeyRequest.withKeyName(keyName); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateKeyRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(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); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<DomainInner> 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(); + } + }; + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> 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)); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<DomainInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventGridManagementClientImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventGridManagementClientImpl.java new file mode 100644 index 000000000000..391d1190b5f6 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventGridManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the EventGridManagementClientImpl class. + */ +public class EventGridManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public EventGridManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public EventGridManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public EventGridManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public EventGridManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The DomainsInner object to access its operations. + */ + private DomainsInner domains; + + /** + * Gets the DomainsInner object to access its operations. + * @return the DomainsInner object. + */ + public DomainsInner domains() { + return this.domains; + } + + /** + * The DomainTopicsInner object to access its operations. + */ + private DomainTopicsInner domainTopics; + + /** + * Gets the DomainTopicsInner object to access its operations. + * @return the DomainTopicsInner object. + */ + public DomainTopicsInner domainTopics() { + return this.domainTopics; + } + + /** + * The EventSubscriptionsInner object to access its operations. + */ + private EventSubscriptionsInner eventSubscriptions; + + /** + * Gets the EventSubscriptionsInner object to access its operations. + * @return the EventSubscriptionsInner object. + */ + public EventSubscriptionsInner eventSubscriptions() { + return this.eventSubscriptions; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The TopicsInner object to access its operations. + */ + private TopicsInner topics; + + /** + * Gets the TopicsInner object to access its operations. + * @return the TopicsInner object. + */ + public TopicsInner topics() { + return this.topics; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + + /** + * The TopicTypesInner object to access its operations. + */ + private TopicTypesInner topicTypes; + + /** + * Gets the TopicTypesInner object to access its operations. + * @return the TopicTypesInner object. + */ + public TopicTypesInner topicTypes() { + return this.topicTypes; + } + + /** + * Initializes an instance of EventGridManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public EventGridManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of EventGridManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public EventGridManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of EventGridManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public EventGridManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-06-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.domains = new DomainsInner(restClient().retrofit(), this); + this.domainTopics = new DomainTopicsInner(restClient().retrofit(), this); + this.eventSubscriptions = new EventSubscriptionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.topics = new TopicsInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.topicTypes = new TopicTypesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "EventGridManagementClient", "2020-06-01"); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventGridManager.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventGridManager.java new file mode 100644 index 000000000000..ca2adbc714ea --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventGridManager.java @@ -0,0 +1,183 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Domains; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DomainTopics; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptions; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Operations; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Topics; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnections; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateLinkResources; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypes; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure EventGrid resource management. + */ +public final class EventGridManager extends ManagerCore { + private Domains domains; + private DomainTopics domainTopics; + private EventSubscriptions eventSubscriptions; + private Operations operations; + private Topics topics; + private PrivateEndpointConnections privateEndpointConnections; + private PrivateLinkResources privateLinkResources; + private TopicTypes topicTypes; + /** + * Get a Configurable instance that can be used to create EventGridManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new EventGridManager.ConfigurableImpl(); + } + /** + * Creates an instance of EventGridManager that exposes EventGrid resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the EventGridManager + */ + public static EventGridManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new EventGridManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of EventGridManager that exposes EventGrid resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the EventGridManager + */ + public static EventGridManager authenticate(RestClient restClient, String subscriptionId) { + return new EventGridManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of EventGridManager that exposes EventGrid management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing EventGrid management API entry points that work across subscriptions + */ + EventGridManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Domains. + */ + public Domains domains() { + if (this.domains == null) { + this.domains = new DomainsImpl(this); + } + return this.domains; + } + + /** + * @return Entry point to manage DomainTopics. + */ + public DomainTopics domainTopics() { + if (this.domainTopics == null) { + this.domainTopics = new DomainTopicsImpl(this); + } + return this.domainTopics; + } + + /** + * @return Entry point to manage EventSubscriptions. + */ + public EventSubscriptions eventSubscriptions() { + if (this.eventSubscriptions == null) { + this.eventSubscriptions = new EventSubscriptionsImpl(this); + } + return this.eventSubscriptions; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Topics. + */ + public Topics topics() { + if (this.topics == null) { + this.topics = new TopicsImpl(this); + } + return this.topics; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + + /** + * @return Entry point to manage TopicTypes. + */ + public TopicTypes topicTypes() { + if (this.topicTypes == null) { + this.topicTypes = new TopicTypesImpl(this); + } + return this.topicTypes; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public EventGridManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return EventGridManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private EventGridManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new EventGridManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionFullUrlImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionFullUrlImpl.java new file mode 100644 index 000000000000..d920f056252f --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionFullUrlImpl.java @@ -0,0 +1,31 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionFullUrl; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventSubscriptionFullUrlImpl extends WrapperImpl implements EventSubscriptionFullUrl { + private final EventGridManager manager; + EventSubscriptionFullUrlImpl(EventSubscriptionFullUrlInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String endpointUrl() { + return this.inner().endpointUrl(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionFullUrlInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionFullUrlInner.java new file mode 100644 index 000000000000..269ab71aab69 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionFullUrlInner.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.eventgrid.v2020_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Full endpoint url of an event subscription. + */ +public class EventSubscriptionFullUrlInner { + /** + * The URL that represents the endpoint of the destination of an event + * subscription. + */ + @JsonProperty(value = "endpointUrl") + private String endpointUrl; + + /** + * Get the URL that represents the endpoint of the destination of an event subscription. + * + * @return the endpointUrl value + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the URL that represents the endpoint of the destination of an event subscription. + * + * @param endpointUrl the endpointUrl value to set + * @return the EventSubscriptionFullUrlInner object itself. + */ + public EventSubscriptionFullUrlInner withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionImpl.java new file mode 100644 index 000000000000..4cbcad6a3436 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionImpl.java @@ -0,0 +1,237 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionUpdateParameters; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionFilter; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventDeliverySchema; +import com.microsoft.azure.management.eventgrid.v2020_06_01.RetryPolicy; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DeadLetterDestination; +import rx.functions.Func1; + +class EventSubscriptionImpl extends CreatableUpdatableImpl implements EventSubscription, EventSubscription.Definition, EventSubscription.Update { + private String scope; + private String eventSubscriptionName; + private EventSubscriptionUpdateParameters updateParameter; + private final EventGridManager manager; + + EventSubscriptionImpl(String name, EventGridManager manager) { + super(name, new EventSubscriptionInner()); + this.manager = manager; + // Set resource name + this.eventSubscriptionName = name; + // + this.updateParameter = new EventSubscriptionUpdateParameters(); + } + + EventSubscriptionImpl(EventSubscriptionInner inner, EventGridManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.eventSubscriptionName = inner.name(); + // set resource ancestor and positional variables + this.eventSubscriptionName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventSubscriptions"); + this.scope = IdParsingUtils.getValueFromIdByPosition(inner.id(), 0); + // set other parameters for create and update + this.updateParameter = new EventSubscriptionUpdateParameters(); + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EventSubscriptionsInner client = this.manager().inner().eventSubscriptions(); + return client.createOrUpdateAsync(this.scope, this.eventSubscriptionName, this.inner()) + .map(new Func1() { + @Override + public EventSubscriptionInner call(EventSubscriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EventSubscriptionsInner client = this.manager().inner().eventSubscriptions(); + return client.updateAsync(this.scope, this.eventSubscriptionName, this.updateParameter) + .map(new Func1() { + @Override + public EventSubscriptionInner call(EventSubscriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EventSubscriptionsInner client = this.manager().inner().eventSubscriptions(); + return client.getAsync(this.scope, this.eventSubscriptionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new EventSubscriptionUpdateParameters(); + } + + @Override + public DeadLetterDestination deadLetterDestination() { + return this.inner().deadLetterDestination(); + } + + @Override + public EventSubscriptionDestination destination() { + return this.inner().destination(); + } + + @Override + public EventDeliverySchema eventDeliverySchema() { + return this.inner().eventDeliverySchema(); + } + + @Override + public DateTime expirationTimeUtc() { + return this.inner().expirationTimeUtc(); + } + + @Override + public EventSubscriptionFilter filter() { + return this.inner().filter(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List labels() { + return this.inner().labels(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public EventSubscriptionProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RetryPolicy retryPolicy() { + return this.inner().retryPolicy(); + } + + @Override + public String topic() { + return this.inner().topic(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public EventSubscriptionImpl withScope(String scope) { + this.scope = scope; + return this; + } + + @Override + public EventSubscriptionImpl withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + if (isInCreateMode()) { + this.inner().withDeadLetterDestination(deadLetterDestination); + } else { + this.updateParameter.withDeadLetterDestination(deadLetterDestination); + } + return this; + } + + @Override + public EventSubscriptionImpl withDestination(EventSubscriptionDestination destination) { + if (isInCreateMode()) { + this.inner().withDestination(destination); + } else { + this.updateParameter.withDestination(destination); + } + return this; + } + + @Override + public EventSubscriptionImpl withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + if (isInCreateMode()) { + this.inner().withEventDeliverySchema(eventDeliverySchema); + } else { + this.updateParameter.withEventDeliverySchema(eventDeliverySchema); + } + return this; + } + + @Override + public EventSubscriptionImpl withExpirationTimeUtc(DateTime expirationTimeUtc) { + if (isInCreateMode()) { + this.inner().withExpirationTimeUtc(expirationTimeUtc); + } else { + this.updateParameter.withExpirationTimeUtc(expirationTimeUtc); + } + return this; + } + + @Override + public EventSubscriptionImpl withFilter(EventSubscriptionFilter filter) { + if (isInCreateMode()) { + this.inner().withFilter(filter); + } else { + this.updateParameter.withFilter(filter); + } + return this; + } + + @Override + public EventSubscriptionImpl withLabels(List labels) { + if (isInCreateMode()) { + this.inner().withLabels(labels); + } else { + this.updateParameter.withLabels(labels); + } + return this; + } + + @Override + public EventSubscriptionImpl withRetryPolicy(RetryPolicy retryPolicy) { + if (isInCreateMode()) { + this.inner().withRetryPolicy(retryPolicy); + } else { + this.updateParameter.withRetryPolicy(retryPolicy); + } + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionInner.java new file mode 100644 index 000000000000..424189f121d8 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionInner.java @@ -0,0 +1,245 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionFilter; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventDeliverySchema; +import com.microsoft.azure.management.eventgrid.v2020_06_01.RetryPolicy; +import com.microsoft.azure.management.eventgrid.v2020_06_01.DeadLetterDestination; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Event Subscription. + */ +@JsonFlatten +public class EventSubscriptionInner extends ProxyResource { + /** + * Name of the topic of the event subscription. + */ + @JsonProperty(value = "properties.topic", access = JsonProperty.Access.WRITE_ONLY) + private String topic; + + /** + * Provisioning state of the event subscription. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed', + * 'AwaitingManualAction'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EventSubscriptionProvisioningState provisioningState; + + /** + * Information about the destination where events have to be delivered for + * the event subscription. + */ + @JsonProperty(value = "properties.destination") + private EventSubscriptionDestination destination; + + /** + * Information about the filter for the event subscription. + */ + @JsonProperty(value = "properties.filter") + private EventSubscriptionFilter filter; + + /** + * List of user defined labels. + */ + @JsonProperty(value = "properties.labels") + private List labels; + + /** + * Expiration time of the event subscription. + */ + @JsonProperty(value = "properties.expirationTimeUtc") + private DateTime expirationTimeUtc; + + /** + * The event delivery schema for the event subscription. Possible values + * include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0'. + */ + @JsonProperty(value = "properties.eventDeliverySchema") + private EventDeliverySchema eventDeliverySchema; + + /** + * The retry policy for events. This can be used to configure maximum + * number of delivery attempts and time to live for events. + */ + @JsonProperty(value = "properties.retryPolicy") + private RetryPolicy retryPolicy; + + /** + * The DeadLetter destination of the event subscription. + */ + @JsonProperty(value = "properties.deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + + /** + * Get name of the topic of the event subscription. + * + * @return the topic value + */ + public String topic() { + return this.topic; + } + + /** + * Get provisioning state of the event subscription. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed', 'AwaitingManualAction'. + * + * @return the provisioningState value + */ + public EventSubscriptionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get information about the destination where events have to be delivered for the event subscription. + * + * @return the destination value + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set information about the destination where events have to be delivered for the event subscription. + * + * @param destination the destination value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get information about the filter for the event subscription. + * + * @return the filter value + */ + public EventSubscriptionFilter filter() { + return this.filter; + } + + /** + * Set information about the filter for the event subscription. + * + * @param filter the filter value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withFilter(EventSubscriptionFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get list of user defined labels. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set list of user defined labels. + * + * @param labels the labels value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get expiration time of the event subscription. + * + * @return the expirationTimeUtc value + */ + public DateTime expirationTimeUtc() { + return this.expirationTimeUtc; + } + + /** + * Set expiration time of the event subscription. + * + * @param expirationTimeUtc the expirationTimeUtc value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withExpirationTimeUtc(DateTime expirationTimeUtc) { + this.expirationTimeUtc = expirationTimeUtc; + return this; + } + + /** + * Get the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0'. + * + * @return the eventDeliverySchema value + */ + public EventDeliverySchema eventDeliverySchema() { + return this.eventDeliverySchema; + } + + /** + * Set the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CustomInputSchema', 'CloudEventSchemaV1_0'. + * + * @param eventDeliverySchema the eventDeliverySchema value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + this.eventDeliverySchema = eventDeliverySchema; + return this; + } + + /** + * Get the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @param retryPolicy the retryPolicy value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get the DeadLetter destination of the event subscription. + * + * @return the deadLetterDestination value + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the DeadLetter destination of the event subscription. + * + * @param deadLetterDestination the deadLetterDestination value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionsImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionsImpl.java new file mode 100644 index 000000000000..0f9455400100 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionsImpl.java @@ -0,0 +1,277 @@ +/** + * 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. + * jkl + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscription; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionFullUrl; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class EventSubscriptionsImpl extends WrapperImpl implements EventSubscriptions { + private PagedListConverter converter; + private final EventGridManager manager; + + EventSubscriptionsImpl(EventGridManager manager) { + super(manager.inner().eventSubscriptions()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(EventSubscriptionInner inner) { + return Observable.just((EventSubscription) wrapModel(inner)); + } + }; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public EventSubscriptionImpl define(String name) { + return wrapModel(name); + } + + private EventSubscriptionImpl wrapModel(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + + private EventSubscriptionImpl wrapModel(String name) { + return new EventSubscriptionImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String scope, String eventSubscriptionName) { + EventSubscriptionsInner client = this.inner(); + return client.getAsync(scope, eventSubscriptionName) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String scope, String eventSubscriptionName) { + EventSubscriptionsInner client = this.inner(); + return client.deleteAsync(scope, eventSubscriptionName).toCompletable(); + } + + @Override + public Observable getFullUrlAsync(String scope, String eventSubscriptionName) { + EventSubscriptionsInner client = this.inner(); + return client.getFullUrlAsync(scope, eventSubscriptionName) + .map(new Func1() { + @Override + public EventSubscriptionFullUrl call(EventSubscriptionFullUrlInner inner) { + return new EventSubscriptionFullUrlImpl(inner, manager()); + } + }); + } + + @Override + public Observable listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listGlobalBySubscriptionForTopicTypeAsync(topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listGlobalByResourceGroupForTopicTypeAsync(resourceGroupName, topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalBySubscriptionAsync(final String location) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalBySubscriptionAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalByResourceGroupAsync(final String resourceGroupName, final String location) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalByResourceGroupAsync(resourceGroupName, location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalBySubscriptionForTopicTypeAsync(location, topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalByResourceGroupForTopicTypeAsync(resourceGroupName, location, topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + EventSubscriptionsInner client = this.inner(); + return client.listByResourceAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName) { + EventSubscriptionsInner client = this.inner(); + return client.listByDomainTopicAsync(resourceGroupName, domainName, topicName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public PagedList list() { + EventSubscriptionsInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + EventSubscriptionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + EventSubscriptionsInner client = this.inner(); + return converter.convert(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + EventSubscriptionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionsInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionsInner.java new file mode 100644 index 000000000000..dd995a991dae --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventSubscriptionsInner.java @@ -0,0 +1,4614 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptionUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EventSubscriptions. + */ +public class EventSubscriptionsInner implements InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private EventSubscriptionsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of EventSubscriptionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EventSubscriptionsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(EventSubscriptionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EventSubscriptions to be + * used by Retrofit to perform actually REST calls. + */ + interface EventSubscriptionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptions get" }) + @GET("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> get(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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.eventgrid.v2020_06_01.EventSubscriptions createOrUpdate" }) + @PUT("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> createOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionInner eventSubscriptionInfo, @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.eventgrid.v2020_06_01.EventSubscriptions beginCreateOrUpdate" }) + @PUT("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> beginCreateOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionInner eventSubscriptionInfo, @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.eventgrid.v2020_06_01.EventSubscriptions delete" }) + @HTTP(path = "{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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.eventgrid.v2020_06_01.EventSubscriptions beginDelete" }) + @HTTP(path = "{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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.eventgrid.v2020_06_01.EventSubscriptions update" }) + @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> update(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, @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.eventgrid.v2020_06_01.EventSubscriptions beginUpdate" }) + @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> beginUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, @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.eventgrid.v2020_06_01.EventSubscriptions getFullUrl" }) + @POST("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl") + Observable> getFullUrl(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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.eventgrid.v2020_06_01.EventSubscriptions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listGlobalBySubscriptionForTopicType" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listGlobalBySubscriptionForTopicType(@Path("subscriptionId") String subscriptionId, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listGlobalByResourceGroupForTopicType" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listGlobalByResourceGroupForTopicType(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listRegionalBySubscription" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions") + Observable> listRegionalBySubscription(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listRegionalByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions") + Observable> listRegionalByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listRegionalBySubscriptionForTopicType" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listRegionalBySubscriptionForTopicType(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listRegionalByResourceGroupForTopicType" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listRegionalByResourceGroupForTopicType(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listByResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> listByResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerNamespace") String providerNamespace, @Path("resourceTypeName") String resourceTypeName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listByDomainTopic" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> listByDomainTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.EventSubscriptions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptions listGlobalBySubscriptionForTopicTypeNext" }) + @GET + Observable> listGlobalBySubscriptionForTopicTypeNext(@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.eventgrid.v2020_06_01.EventSubscriptions listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.EventSubscriptions listGlobalByResourceGroupForTopicTypeNext" }) + @GET + Observable> listGlobalByResourceGroupForTopicTypeNext(@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.eventgrid.v2020_06_01.EventSubscriptions listRegionalBySubscriptionNext" }) + @GET + Observable> listRegionalBySubscriptionNext(@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.eventgrid.v2020_06_01.EventSubscriptions listRegionalByResourceGroupNext" }) + @GET + Observable> listRegionalByResourceGroupNext(@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.eventgrid.v2020_06_01.EventSubscriptions listRegionalBySubscriptionForTopicTypeNext" }) + @GET + Observable> listRegionalBySubscriptionForTopicTypeNext(@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.eventgrid.v2020_06_01.EventSubscriptions listRegionalByResourceGroupForTopicTypeNext" }) + @GET + Observable> listRegionalByResourceGroupForTopicTypeNext(@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.eventgrid.v2020_06_01.EventSubscriptions listByResourceNext" }) + @GET + Observable> listByResourceNext(@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.eventgrid.v2020_06_01.EventSubscriptions listByDomainTopicNext" }) + @GET + Observable> listByDomainTopicNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner get(String scope, String eventSubscriptionName) { + return getWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body(); + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable getAsync(String scope, String eventSubscriptionName) { + return getWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable> getWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner createOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().last().body(); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo), serviceCallback); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionInfo == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionInfo 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(eventSubscriptionInfo); + Observable> observable = service.createOrUpdate(scope, eventSubscriptionName, eventSubscriptionInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner beginCreateOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().single().body(); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 beginCreateOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo), serviceCallback); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable beginCreateOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionInfo == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionInfo 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(eventSubscriptionInfo); + return service.beginCreateOrUpdate(scope, eventSubscriptionName, eventSubscriptionInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 + */ + public void delete(String scope, String eventSubscriptionName) { + deleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().last().body(); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String scope, String eventSubscriptionName) { + return deleteWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 + */ + public void beginDelete(String scope, String eventSubscriptionName) { + beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body(); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String scope, String eventSubscriptionName) { + return beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner update(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().last().body(); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters), serviceCallback); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionUpdateParameters == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters 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(eventSubscriptionUpdateParameters); + Observable> observable = service.update(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner beginUpdate(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().single().body(); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters), serviceCallback); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable beginUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionUpdateParameters == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters 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(eventSubscriptionUpdateParameters); + return service.beginUpdate(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 EventSubscriptionFullUrlInner object if successful. + */ + public EventSubscriptionFullUrlInner getFullUrl(String scope, String eventSubscriptionName) { + return getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body(); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFullUrlAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionFullUrlInner object + */ + public Observable getFullUrlAsync(String scope, String eventSubscriptionName) { + return getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, EventSubscriptionFullUrlInner>() { + @Override + public EventSubscriptionFullUrlInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionFullUrlInner object + */ + public Observable> getFullUrlWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName 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.getFullUrl(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFullUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFullUrlDelegate(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); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @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 PagedList<EventSubscriptionInner> 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(); + } + }; + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> 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)); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, 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); + } + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList list(final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listAsync(final String filter, final Integer top) { + return listWithServiceResponseAsync(filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top) { + return listSinglePageAsync(filter, top) + .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)); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalBySubscriptionForTopicType(final String topicTypeName) { + ServiceResponse> response = listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @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> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName) { + return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(final String topicTypeName) { + return listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName) + .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(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalBySubscriptionForTopicTypeSinglePageAsync(final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalBySubscriptionForTopicType(final String topicTypeName, final String filter, final Integer top) { + ServiceResponse> response = listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final String filter, final Integer top) { + return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(final String topicTypeName, final String filter, final Integer top) { + return listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top) + .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(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + ServiceResponse> * @param topicTypeName Name of the topic type. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalBySubscriptionForTopicTypeSinglePageAsync(final String topicTypeName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName 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.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalBySubscriptionForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalByResourceGroupForTopicType(final String resourceGroupName, final String topicTypeName) { + ServiceResponse> response = listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @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> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName) { + return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String topicTypeName) { + return listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName) + .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(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalByResourceGroupForTopicType(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) { + ServiceResponse> response = listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) { + return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) { + return listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top) + .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(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param topicTypeName Name of the topic type. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName 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.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalByResourceGroupForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscription(final String location) { + ServiceResponse> response = listRegionalBySubscriptionSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @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> listRegionalBySubscriptionAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionAsync(final String location) { + return listRegionalBySubscriptionWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionWithServiceResponseAsync(final String location) { + return listRegionalBySubscriptionSinglePageAsync(location) + .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(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionSinglePageAsync(final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscription(final String location, final String filter, final Integer top) { + ServiceResponse> response = listRegionalBySubscriptionSinglePageAsync(location, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listRegionalBySubscriptionAsync(final String location, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionSinglePageAsync(location, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionAsync(final String location, final String filter, final Integer top) { + return listRegionalBySubscriptionWithServiceResponseAsync(location, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionWithServiceResponseAsync(final String location, final String filter, final Integer top) { + return listRegionalBySubscriptionSinglePageAsync(location, filter, top) + .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(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + ServiceResponse> * @param location Name of the location. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionSinglePageAsync(final String location, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroup(final String resourceGroupName, final String location) { + ServiceResponse> response = listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @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> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location) { + return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String location) { + return listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location) + .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(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroup(final String resourceGroupName, final String location, final String filter, final Integer top) { + ServiceResponse> response = listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final String filter, final Integer top) { + return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String location, final String filter, final Integer top) { + return listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top) + .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(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param location Name of the location. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionForTopicType(final String location, final String topicTypeName) { + ServiceResponse> response = listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @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> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName) { + return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(final String location, final String topicTypeName) { + return listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName) + .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(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionForTopicTypeSinglePageAsync(final String location, final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionForTopicType(final String location, final String topicTypeName, final String filter, final Integer top) { + ServiceResponse> response = listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final String filter, final Integer top) { + return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(final String location, final String topicTypeName, final String filter, final Integer top) { + return listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top) + .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(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + ServiceResponse> * @param location Name of the location. + ServiceResponse> * @param topicTypeName Name of the topic type. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionForTopicTypeSinglePageAsync(final String location, final String topicTypeName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName 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.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupForTopicType(final String resourceGroupName, final String location, final String topicTypeName) { + ServiceResponse> response = listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @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> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName) { + return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String location, final String topicTypeName) { + return listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName) + .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(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String location, final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupForTopicType(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) { + ServiceResponse> response = listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) { + return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location. + * @param topicTypeName Name of the topic type. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) { + return listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top) + .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(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param location Name of the location. + ServiceResponse> * @param topicTypeName Name of the topic type. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName 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.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @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> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + return listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerNamespace == null) { + throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."); + } + if (resourceTypeName == null) { + throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResource(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) { + return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the resource type. + * @param resourceName Name of the resource. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) { + return listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top) + .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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param providerNamespace Namespace of the provider of the topic. + ServiceResponse> * @param resourceTypeName Name of the resource type. + ServiceResponse> * @param resourceName Name of the resource. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerNamespace == null) { + throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."); + } + if (resourceTypeName == null) { + throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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.listByResource(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByDomainTopic(final String resourceGroupName, final String domainName, final String topicName) { + ServiceResponse> response = listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @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> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName) { + return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByDomainTopicWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String topicName) { + return listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName) + .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(listByDomainTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainTopicSinglePageAsync(final String resourceGroupName, final String domainName, final String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByDomainTopic(this.client.subscriptionId(), resourceGroupName, domainName, topicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByDomainTopic(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) { + ServiceResponse> response = listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) { + return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain. + * @param topicName Name of the domain topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByDomainTopicWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) { + return listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top) + .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(listByDomainTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param domainName Name of the top level domain. + ServiceResponse> * @param topicName Name of the domain topic. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainTopicSinglePageAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName 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.listByDomainTopic(this.client.subscriptionId(), resourceGroupName, domainName, topicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainTopicDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> 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(); + } + }; + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> 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)); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalBySubscriptionForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @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> listGlobalBySubscriptionForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeNextAsync(final String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(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(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(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.listGlobalBySubscriptionForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalBySubscriptionForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalByResourceGroupForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @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> listGlobalByResourceGroupForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeNextAsync(final String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(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(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(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.listGlobalByResourceGroupForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalByResourceGroupForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionNext(final String nextPageLink) { + ServiceResponse> response = listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionNextAsync(final String nextPageLink) { + return listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(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(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionNextSinglePageAsync(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.listRegionalBySubscriptionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupNextAsync(final String nextPageLink) { + return listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(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(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupNextSinglePageAsync(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.listRegionalByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @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> listRegionalBySubscriptionForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeNextAsync(final String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(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(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(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.listRegionalBySubscriptionForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @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> listRegionalByResourceGroupForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeNextAsync(final String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @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<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(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(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(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.listRegionalByResourceGroupForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceNext(final String nextPageLink) { + ServiceResponse> response = listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @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> listByResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @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<EventSubscriptionInner> object + */ + public Observable> listByResourceNextAsync(final String nextPageLink) { + return listByResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @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<EventSubscriptionInner> object + */ + public Observable>> listByResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceNextSinglePageAsync(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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceNextSinglePageAsync(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.listByResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByDomainTopicNext(final String nextPageLink) { + ServiceResponse> response = listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @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> listByDomainTopicNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainTopicNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @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<EventSubscriptionInner> object + */ + public Observable> listByDomainTopicNextAsync(final String nextPageLink) { + return listByDomainTopicNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @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<EventSubscriptionInner> object + */ + public Observable>> listByDomainTopicNextWithServiceResponseAsync(final String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(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(listByDomainTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainTopicNextSinglePageAsync(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.listByDomainTopicNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainTopicNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainTopicNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventTypeImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventTypeImpl.java new file mode 100644 index 000000000000..6c921ac80c4f --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventTypeImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventType; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class EventTypeImpl extends WrapperImpl implements EventType { + private final EventGridManager manager; + + EventTypeImpl(EventTypeInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isInDefaultSet() { + return this.inner().isInDefaultSet(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String schemaUrl() { + return this.inner().schemaUrl(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventTypeInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventTypeInner.java new file mode 100644 index 000000000000..082ce91ccca7 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/EventTypeInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Event Type for a subject under a topic. + */ +@JsonFlatten +public class EventTypeInner extends ProxyResource { + /** + * Display name of the event type. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Description of the event type. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Url of the schema for this event type. + */ + @JsonProperty(value = "properties.schemaUrl") + private String schemaUrl; + + /** + * IsInDefaultSet flag of the event type. + */ + @JsonProperty(value = "properties.isInDefaultSet") + private Boolean isInDefaultSet; + + /** + * Get display name of the event type. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of the event type. + * + * @param displayName the displayName value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get description of the event type. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the event type. + * + * @param description the description value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get url of the schema for this event type. + * + * @return the schemaUrl value + */ + public String schemaUrl() { + return this.schemaUrl; + } + + /** + * Set url of the schema for this event type. + * + * @param schemaUrl the schemaUrl value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withSchemaUrl(String schemaUrl) { + this.schemaUrl = schemaUrl; + return this; + } + + /** + * Get isInDefaultSet flag of the event type. + * + * @return the isInDefaultSet value + */ + public Boolean isInDefaultSet() { + return this.isInDefaultSet; + } + + /** + * Set isInDefaultSet flag of the event type. + * + * @param isInDefaultSet the isInDefaultSet value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withIsInDefaultSet(Boolean isInDefaultSet) { + this.isInDefaultSet = isInDefaultSet; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/IdParsingUtils.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..f034ecc309c7 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..79ec282fdcf6 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.OperationInfo; + +class OperationImpl extends WrapperImpl implements Operation { + private final EventGridManager manager; + OperationImpl(OperationInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public OperationInfo display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationInner.java new file mode 100644 index 000000000000..87de52b2e821 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationInner.java @@ -0,0 +1,122 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.OperationInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an operation returned by the GetOperations request. + */ +public class OperationInner { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of the operation. + */ + @JsonProperty(value = "display") + private OperationInfo display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of the operation. + * + * @return the display value + */ + public OperationInfo display() { + return this.display; + } + + /** + * Set display name of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationInfo display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationsImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..b7afc32e0df5 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final EventGridManager manager; + + OperationsImpl(EventGridManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationsInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..7eadd8df2854 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/OperationsInner.java @@ -0,0 +1,138 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +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 EventGridManagementClientImpl 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, EventGridManagementClientImpl 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.eventgrid.v2020_06_01.Operations list" }) + @GET("providers/Microsoft.EventGrid/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @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 List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @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 ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + 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); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PageImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PageImpl.java new file mode 100644 index 000000000000..638d2bfd977e --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PageImpl1.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..9c2adb7666ad --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..7f14dc500b80 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,136 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpoint; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.ConnectionState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.ResourceProvisioningState; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Update { + private final EventGridManager manager; + private String resourceGroupName; + private String parentType; + private String parentName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, EventGridManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, EventGridManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.parentType = IdParsingUtils.getValueFromIdByName(inner.id(), "Microsoft.EventGrid"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + this.parentName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 7); + // + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.updateAsync(this.resourceGroupName, this.parentType, this.parentName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List groupIds() { + return this.inner().groupIds(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public ConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public ResourceProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withGroupIds(List groupIds) { + this.inner().withGroupIds(groupIds); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProvisioningState(ResourceProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..cf47cce43c48 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,130 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpoint; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.ConnectionState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.ResourceProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The PrivateEndpointConnectionInner model. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The Private Endpoint resource for this Connection. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * GroupIds from the private link service resource. + */ + @JsonProperty(value = "properties.groupIds") + private List groupIds; + + /** + * Details about the state of the connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private ConnectionState privateLinkServiceConnectionState; + + /** + * Provisioning state of the Private Endpoint Connection. Possible values + * include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', + * 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ResourceProvisioningState provisioningState; + + /** + * Get the Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the Private Endpoint resource for this Connection. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get groupIds from the private link service resource. + * + * @return the groupIds value + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set groupIds from the private link service resource. + * + * @param groupIds the groupIds value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Get details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set details about the state of the connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(ResourceProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionsImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..c317b49fdeb3 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnections; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final EventGridManager manager; + + PrivateEndpointConnectionsImpl(EventGridManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).toCompletable(); + } + + @Override + public Observable listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listByResourceAsync(resourceGroupName, parentType, parentName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionsInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 000000000000..4dfdc0904b0b --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,989 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +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.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.eventgrid.v2020_06_01.PrivateEndpointConnections update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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.eventgrid.v2020_06_01.PrivateEndpointConnections beginUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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.eventgrid.v2020_06_01.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.eventgrid.v2020_06_01.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.eventgrid.v2020_06_01.PrivateEndpointConnections listByResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections") + Observable> listByResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.PrivateEndpointConnections listByResourceNext" }) + @GET + Observable> listByResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a specific private endpoint connection. + * Get a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @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 PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Get a specific private endpoint connection. + * Get a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Get a specific private endpoint connection. + * Get a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific private endpoint connection. + * Get a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @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 PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner update(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().last().body(); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection 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(privateEndpointConnection); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @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 PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginUpdate(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().single().body(); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a specific private endpoint connection. + * Update a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection 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(privateEndpointConnection); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @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 + */ + public void delete(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @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 + */ + public void beginDelete(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a specific private endpoint connection. + * Delete a specific private endpoint connection under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @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 PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String parentType, final String parentName) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, parentType, parentName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, parentType, parentName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName) { + return listByResourceWithServiceResponseAsync(resourceGroupName, parentType, parentName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String parentType, final String parentName) { + return listByResourceSinglePageAsync(resourceGroupName, parentType, parentName) + .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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String parentType, final String parentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResource(this.client.subscriptionId(), resourceGroupName, parentType, parentName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, parentType, parentName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, parentType, parentName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + return listByResourceWithServiceResponseAsync(resourceGroupName, parentType, parentName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + return listByResourceSinglePageAsync(resourceGroupName, parentType, parentName, filter, top) + .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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + ServiceResponse> * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName 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.listByResource(this.client.subscriptionId(), resourceGroupName, parentType, parentName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByResourceNext(final String nextPageLink) { + ServiceResponse> response = listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @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> listByResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @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<PrivateEndpointConnectionInner> object + */ + public Observable> listByResourceNextAsync(final String nextPageLink) { + return listByResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + * @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<PrivateEndpointConnectionInner> object + */ + public Observable>> listByResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceNextSinglePageAsync(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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all private endpoint connections under a resource. + * Get all private endpoint connections under a topic or domain. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceNextSinglePageAsync(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.listByResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourceImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..d92b2aa4b0bf --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourceImpl.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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateLinkResourceImpl extends WrapperImpl implements PrivateLinkResource { + private final EventGridManager manager; + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String groupId() { + return this.inner().groupId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List requiredMembers() { + return this.inner().requiredMembers(); + } + + @Override + public List requiredZoneNames() { + return this.inner().requiredZoneNames(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourceInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..52625e493ab9 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,202 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information of the private link resource. + */ +@JsonFlatten +public class PrivateLinkResourceInner { + /** + * The groupId property. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /** + * The displayName property. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * The requiredMembers property. + */ + @JsonProperty(value = "properties.requiredMembers") + private List requiredMembers; + + /** + * The requiredZoneNames property. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Fully qualified identifier of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the groupId value. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId value. + * + * @param groupId the groupId value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the displayName value. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName value. + * + * @param displayName the displayName value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the requiredMembers value. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers value. + * + * @param requiredMembers the requiredMembers value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames value. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames value. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Get fully qualified identifier of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set fully qualified identifier of the resource. + * + * @param id the id value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource. + * + * @param name the name value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourcesImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..9b52a9c7bd8b --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,61 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateLinkResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateLinkResource; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final EventGridManager manager; + + PrivateLinkResourcesImpl(EventGridManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String parentType, String parentName, String privateLinkResourceName) { + PrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, parentType, parentName, privateLinkResourceName) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listByResourceAsync(resourceGroupName, parentType, parentName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourcesInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 000000000000..3f843c9cd37e --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,571 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +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.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateLinkResourceName") String privateLinkResourceName, @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.eventgrid.v2020_06_01.PrivateLinkResources listByResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources") + Observable> listByResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.PrivateLinkResources listByResourceNext" }) + @GET + Observable> listByResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a private link resource. + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateLinkResourceName The name of private link resource. + * @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 PrivateLinkResourceInner object if successful. + */ + public PrivateLinkResourceInner get(String resourceGroupName, String parentType, String parentName, String privateLinkResourceName) { + return getWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateLinkResourceName).toBlocking().single().body(); + } + + /** + * Get a private link resource. + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateLinkResourceName The name of private link resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String parentType, String parentName, String privateLinkResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateLinkResourceName), serviceCallback); + } + + /** + * Get a private link resource. + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateLinkResourceName The name of private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable getAsync(String resourceGroupName, String parentType, String parentName, String privateLinkResourceName) { + return getWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateLinkResourceName).map(new Func1, PrivateLinkResourceInner>() { + @Override + public PrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a private link resource. + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param privateLinkResourceName The name of private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateLinkResourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (privateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateLinkResourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @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 PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String parentType, final String parentName) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, parentType, parentName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, parentType, parentName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName) { + return listByResourceWithServiceResponseAsync(resourceGroupName, parentType, parentName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String parentType, final String parentName) { + return listByResourceSinglePageAsync(resourceGroupName, parentType, parentName) + .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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String parentType, final String parentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResource(this.client.subscriptionId(), resourceGroupName, parentType, parentName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, parentType, parentName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, parentType, parentName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + return listByResourceWithServiceResponseAsync(resourceGroupName, parentType, parentName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + return listByResourceSinglePageAsync(resourceGroupName, parentType, parentName, filter, top) + .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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. + ServiceResponse> * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String parentType, final String parentName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parentType == null) { + throw new IllegalArgumentException("Parameter parentType is required and cannot be null."); + } + if (parentName == null) { + throw new IllegalArgumentException("Parameter parentName 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.listByResource(this.client.subscriptionId(), resourceGroupName, parentType, parentName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByResourceNext(final String nextPageLink) { + ServiceResponse> response = listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @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> listByResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @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<PrivateLinkResourceInner> object + */ + public Observable> listByResourceNextAsync(final String nextPageLink) { + return listByResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + * @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<PrivateLinkResourceInner> object + */ + public Observable>> listByResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceNextSinglePageAsync(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(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private link resources under specific topic or domain. + * List all the private link resources under a topic or domain. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceNextSinglePageAsync(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.listByResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicImpl.java new file mode 100644 index 000000000000..9a7a95a410c1 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicImpl.java @@ -0,0 +1,159 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Topic; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchema; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchemaMapping; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PublicNetworkAccess; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InboundIpRule; +import java.util.ArrayList; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PrivateEndpointConnection; +import rx.functions.Func1; + +class TopicImpl extends GroupableResourceCoreImpl implements Topic, Topic.Definition, Topic.Update { + private TopicUpdateParameters updateParameter; + TopicImpl(String name, TopicInner inner, EventGridManager manager) { + super(name, inner, manager); + this.updateParameter = new TopicUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public TopicInner call(TopicInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public TopicInner call(TopicInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new TopicUpdateParameters(); + } + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public List inboundIpRules() { + return this.inner().inboundIpRules(); + } + + @Override + public InputSchema inputSchema() { + return this.inner().inputSchema(); + } + + @Override + public InputSchemaMapping inputSchemaMapping() { + return this.inner().inputSchemaMapping(); + } + + @Override + public String metricResourceId() { + return this.inner().metricResourceId(); + } + + @Override + public List privateEndpointConnections() { + List lst = new ArrayList(); + if (this.inner().privateEndpointConnections() != null) { + for (PrivateEndpointConnectionInner inner : this.inner().privateEndpointConnections()) { + lst.add( new PrivateEndpointConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public TopicProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.inner().publicNetworkAccess(); + } + + @Override + public TopicImpl withInputSchema(InputSchema inputSchema) { + this.inner().withInputSchema(inputSchema); + return this; + } + + @Override + public TopicImpl withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inner().withInputSchemaMapping(inputSchemaMapping); + return this; + } + + @Override + public TopicImpl withPrivateEndpointConnections(List privateEndpointConnections) { + this.inner().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + @Override + public TopicImpl withInboundIpRules(List inboundIpRules) { + if (isInCreateMode()) { + this.inner().withInboundIpRules(inboundIpRules); + } else { + this.updateParameter.withInboundIpRules(inboundIpRules); + } + return this; + } + + @Override + public TopicImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.inner().withPublicNetworkAccess(publicNetworkAccess); + } else { + this.updateParameter.withPublicNetworkAccess(publicNetworkAccess); + } + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicInner.java new file mode 100644 index 000000000000..5d9efbb07de3 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicInner.java @@ -0,0 +1,214 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchema; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InputSchemaMapping; +import com.microsoft.azure.management.eventgrid.v2020_06_01.PublicNetworkAccess; +import com.microsoft.azure.management.eventgrid.v2020_06_01.InboundIpRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * EventGrid Topic. + */ +@JsonFlatten +public class TopicInner extends Resource { + /** + * The privateEndpointConnections property. + */ + @JsonProperty(value = "properties.privateEndpointConnections") + private List privateEndpointConnections; + + /** + * Provisioning state of the topic. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private TopicProvisioningState provisioningState; + + /** + * Endpoint for the topic. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * This determines the format that Event Grid should expect for incoming + * events published to the topic. Possible values include: + * 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. + */ + @JsonProperty(value = "properties.inputSchema") + private InputSchema inputSchema; + + /** + * This enables publishing using custom event schemas. An + * InputSchemaMapping can be specified to map various properties of a + * source schema to various required properties of the EventGridEvent + * schema. + */ + @JsonProperty(value = "properties.inputSchemaMapping") + private InputSchemaMapping inputSchemaMapping; + + /** + * Metric resource id for the topic. + */ + @JsonProperty(value = "properties.metricResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String metricResourceId; + + /** + * This determines if traffic is allowed over public network. By default it + * is enabled. + * You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules" + * />. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * This can be used to restrict traffic from specific IPs instead of all + * IPs. Note: These are considered only if PublicNetworkAccess is enabled. + */ + @JsonProperty(value = "properties.inboundIpRules") + private List inboundIpRules; + + /** + * Get the privateEndpointConnections value. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections value. + * + * @param privateEndpointConnections the privateEndpointConnections value to set + * @return the TopicInner object itself. + */ + public TopicInner withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get provisioning state of the topic. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public TopicProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get endpoint for the topic. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get this determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. + * + * @return the inputSchema value + */ + public InputSchema inputSchema() { + return this.inputSchema; + } + + /** + * Set this determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. + * + * @param inputSchema the inputSchema value to set + * @return the TopicInner object itself. + */ + public TopicInner withInputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + return this; + } + + /** + * Get this enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema. + * + * @return the inputSchemaMapping value + */ + public InputSchemaMapping inputSchemaMapping() { + return this.inputSchemaMapping; + } + + /** + * Set this enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema. + * + * @param inputSchemaMapping the inputSchemaMapping value to set + * @return the TopicInner object itself. + */ + public TopicInner withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inputSchemaMapping = inputSchemaMapping; + return this; + } + + /** + * Get metric resource id for the topic. + * + * @return the metricResourceId value + */ + public String metricResourceId() { + return this.metricResourceId; + } + + /** + * Get this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set this determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules" />. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the TopicInner object itself. + */ + public TopicInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set this can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + * + * @param inboundIpRules the inboundIpRules value to set + * @return the TopicInner object itself. + */ + public TopicInner withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicSharedAccessKeysImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicSharedAccessKeysImpl.java new file mode 100644 index 000000000000..83b8dc9fd862 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicSharedAccessKeysImpl.java @@ -0,0 +1,36 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicSharedAccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TopicSharedAccessKeysImpl extends WrapperImpl implements TopicSharedAccessKeys { + private final EventGridManager manager; + TopicSharedAccessKeysImpl(TopicSharedAccessKeysInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String key1() { + return this.inner().key1(); + } + + @Override + public String key2() { + return this.inner().key2(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicSharedAccessKeysInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicSharedAccessKeysInner.java new file mode 100644 index 000000000000..7f842673fcdc --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicSharedAccessKeysInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shared access keys of the Topic. + */ +public class TopicSharedAccessKeysInner { + /** + * Shared access key1 for the topic. + */ + @JsonProperty(value = "key1") + private String key1; + + /** + * Shared access key2 for the topic. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get shared access key1 for the topic. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set shared access key1 for the topic. + * + * @param key1 the key1 value to set + * @return the TopicSharedAccessKeysInner object itself. + */ + public TopicSharedAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get shared access key2 for the topic. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set shared access key2 for the topic. + * + * @param key2 the key2 value to set + * @return the TopicSharedAccessKeysInner object itself. + */ + public TopicSharedAccessKeysInner withKey2(String key2) { + this.key2 = key2; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypeInfoImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypeInfoImpl.java new file mode 100644 index 000000000000..7e99f69b9b95 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypeInfoImpl.java @@ -0,0 +1,79 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypeInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypeProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_06_01.ResourceRegionType; +import java.util.List; + +class TopicTypeInfoImpl extends WrapperImpl implements TopicTypeInfo { + private final EventGridManager manager; + TopicTypeInfoImpl(TopicTypeInfoInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provider() { + return this.inner().provider(); + } + + @Override + public TopicTypeProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ResourceRegionType resourceRegionType() { + return this.inner().resourceRegionType(); + } + + @Override + public String sourceResourceFormat() { + return this.inner().sourceResourceFormat(); + } + + @Override + public List supportedLocations() { + return this.inner().supportedLocations(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypeInfoInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypeInfoInner.java new file mode 100644 index 000000000000..d0e5484c21e3 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypeInfoInner.java @@ -0,0 +1,207 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2020_06_01.ResourceRegionType; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypeProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Properties of a topic type info. + */ +@JsonFlatten +public class TopicTypeInfoInner extends ProxyResource { + /** + * Namespace of the provider of the topic type. + */ + @JsonProperty(value = "properties.provider") + private String provider; + + /** + * Display Name for the topic type. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Description of the topic type. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Region type of the resource. Possible values include: + * 'RegionalResource', 'GlobalResource'. + */ + @JsonProperty(value = "properties.resourceRegionType") + private ResourceRegionType resourceRegionType; + + /** + * Provisioning state of the topic type. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private TopicTypeProvisioningState provisioningState; + + /** + * List of locations supported by this topic type. + */ + @JsonProperty(value = "properties.supportedLocations") + private List supportedLocations; + + /** + * Source resource format. + */ + @JsonProperty(value = "properties.sourceResourceFormat") + private String sourceResourceFormat; + + /** + * Get namespace of the provider of the topic type. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set namespace of the provider of the topic type. + * + * @param provider the provider value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get display Name for the topic type. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display Name for the topic type. + * + * @param displayName the displayName value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get description of the topic type. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the topic type. + * + * @param description the description value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get region type of the resource. Possible values include: 'RegionalResource', 'GlobalResource'. + * + * @return the resourceRegionType value + */ + public ResourceRegionType resourceRegionType() { + return this.resourceRegionType; + } + + /** + * Set region type of the resource. Possible values include: 'RegionalResource', 'GlobalResource'. + * + * @param resourceRegionType the resourceRegionType value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withResourceRegionType(ResourceRegionType resourceRegionType) { + this.resourceRegionType = resourceRegionType; + return this; + } + + /** + * Get provisioning state of the topic type. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public TopicTypeProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the topic type. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withProvisioningState(TopicTypeProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get list of locations supported by this topic type. + * + * @return the supportedLocations value + */ + public List supportedLocations() { + return this.supportedLocations; + } + + /** + * Set list of locations supported by this topic type. + * + * @param supportedLocations the supportedLocations value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withSupportedLocations(List supportedLocations) { + this.supportedLocations = supportedLocations; + return this; + } + + /** + * Get source resource format. + * + * @return the sourceResourceFormat value + */ + public String sourceResourceFormat() { + return this.sourceResourceFormat; + } + + /** + * Set source resource format. + * + * @param sourceResourceFormat the sourceResourceFormat value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withSourceResourceFormat(String sourceResourceFormat) { + this.sourceResourceFormat = sourceResourceFormat; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypesImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypesImpl.java new file mode 100644 index 000000000000..d1760ae79e3b --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypesImpl.java @@ -0,0 +1,84 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypes; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventType; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypeInfo; + +class TopicTypesImpl extends WrapperImpl implements TopicTypes { + private final EventGridManager manager; + + TopicTypesImpl(EventGridManager manager) { + super(manager.inner().topicTypes()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + private EventTypeImpl wrapModel(EventTypeInner inner) { + return new EventTypeImpl(inner, manager()); + } + + @Override + public Observable listEventTypesAsync(String topicTypeName) { + TopicTypesInner client = this.inner(); + return client.listEventTypesAsync(topicTypeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventType call(EventTypeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String topicTypeName) { + TopicTypesInner client = this.inner(); + return client.getAsync(topicTypeName) + .map(new Func1() { + @Override + public TopicTypeInfo call(TopicTypeInfoInner inner) { + return new TopicTypeInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + TopicTypesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public TopicTypeInfo call(TopicTypeInfoInner inner) { + return new TopicTypeInfoImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypesInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypesInner.java new file mode 100644 index 000000000000..fe8c980db1ba --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicTypesInner.java @@ -0,0 +1,312 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TopicTypes. + */ +public class TopicTypesInner { + /** The Retrofit service to perform REST calls. */ + private TopicTypesService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of TopicTypesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TopicTypesInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(TopicTypesService.class); + this.client = client; + } + + /** + * The interface defining all the services for TopicTypes to be + * used by Retrofit to perform actually REST calls. + */ + interface TopicTypesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.TopicTypes list" }) + @GET("providers/Microsoft.EventGrid/topicTypes") + 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.eventgrid.v2020_06_01.TopicTypes get" }) + @GET("providers/Microsoft.EventGrid/topicTypes/{topicTypeName}") + Observable> get(@Path("topicTypeName") String topicTypeName, @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.eventgrid.v2020_06_01.TopicTypes listEventTypes" }) + @GET("providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes") + Observable> listEventTypes(@Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List topic types. + * List all registered topic types. + * + * @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 List<TopicTypeInfoInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List topic types. + * List all registered topic types. + * + * @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 ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TopicTypeInfoInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TopicTypeInfoInner> object + */ + public Observable>> listWithServiceResponseAsync() { + 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); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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) + .build(response); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type. + * @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 TopicTypeInfoInner object if successful. + */ + public TopicTypeInfoInner get(String topicTypeName) { + return getWithServiceResponseAsync(topicTypeName).toBlocking().single().body(); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String topicTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(topicTypeName), serviceCallback); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicTypeInfoInner object + */ + public Observable getAsync(String topicTypeName) { + return getWithServiceResponseAsync(topicTypeName).map(new Func1, TopicTypeInfoInner>() { + @Override + public TopicTypeInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicTypeInfoInner object + */ + public Observable> getWithServiceResponseAsync(String topicTypeName) { + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type. + * @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 List<EventTypeInner> object if successful. + */ + public List listEventTypes(String topicTypeName) { + return listEventTypesWithServiceResponseAsync(topicTypeName).toBlocking().single().body(); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type. + * @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> listEventTypesAsync(String topicTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listEventTypesWithServiceResponseAsync(topicTypeName), serviceCallback); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable> listEventTypesAsync(String topicTypeName) { + return listEventTypesWithServiceResponseAsync(topicTypeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable>> listEventTypesWithServiceResponseAsync(String topicTypeName) { + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName 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.listEventTypes(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventTypesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventTypesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicsImpl.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicsImpl.java new file mode 100644 index 000000000000..11c8f9783143 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicsImpl.java @@ -0,0 +1,183 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Topics; +import com.microsoft.azure.management.eventgrid.v2020_06_01.Topic; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicSharedAccessKeys; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2020_06_01.EventType; + +class TopicsImpl extends GroupableResourcesCoreImpl implements Topics { + protected TopicsImpl(EventGridManager manager) { + super(manager.inner().topics(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + TopicsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + TopicsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + TopicsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + TopicsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Topic call(TopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + TopicsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + TopicsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Topic call(TopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public TopicImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listSharedAccessKeysAsync(String resourceGroupName, String topicName) { + TopicsInner client = this.inner(); + return client.listSharedAccessKeysAsync(resourceGroupName, topicName) + .map(new Func1() { + @Override + public TopicSharedAccessKeys call(TopicSharedAccessKeysInner inner) { + return new TopicSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String topicName, String keyName) { + TopicsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, topicName, keyName) + .map(new Func1() { + @Override + public TopicSharedAccessKeys call(TopicSharedAccessKeysInner inner) { + return new TopicSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + protected TopicImpl wrapModel(TopicInner inner) { + return new TopicImpl(inner.name(), inner, manager()); + } + + @Override + protected TopicImpl wrapModel(String name) { + return new TopicImpl(name, new TopicInner(), this.manager()); + } + + @Override + public Observable listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + TopicsInner client = this.inner(); + return client.listEventTypesAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventType call(EventTypeInner inner) { + return new EventTypeImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicsInner.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicsInner.java new file mode 100644 index 000000000000..2448508525d1 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/TopicsInner.java @@ -0,0 +1,1744 @@ +/** + * 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.eventgrid.v2020_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicRegenerateKeyRequest; +import com.microsoft.azure.management.eventgrid.v2020_06_01.TopicUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Topics. + */ +public class TopicsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private TopicsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of TopicsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TopicsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(TopicsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Topics to be + * used by Retrofit to perform actually REST calls. + */ + interface TopicsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.Topics getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @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.eventgrid.v2020_06_01.Topics createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicInner topicInfo, @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.eventgrid.v2020_06_01.Topics beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicInner topicInfo, @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.eventgrid.v2020_06_01.Topics delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @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.eventgrid.v2020_06_01.Topics beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @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.eventgrid.v2020_06_01.Topics update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicUpdateParameters topicUpdateParameters, @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.eventgrid.v2020_06_01.Topics beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicUpdateParameters topicUpdateParameters, @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.eventgrid.v2020_06_01.Topics list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.Topics listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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.eventgrid.v2020_06_01.Topics listSharedAccessKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys") + Observable> listSharedAccessKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @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.eventgrid.v2020_06_01.Topics regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicRegenerateKeyRequest regenerateKeyRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.Topics listEventTypes" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes") + Observable> listEventTypes(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerNamespace") String providerNamespace, @Path("resourceTypeName") String resourceTypeName, @Path("resourceName") String resourceName, @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.eventgrid.v2020_06_01.Topics listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_06_01.Topics listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @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 TopicInner object if successful. + */ + public TopicInner getByResourceGroup(String resourceGroupName, String topicName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String topicName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @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 TopicInner object if successful. + */ + public TopicInner createOrUpdate(String resourceGroupName, String topicName, TopicInner topicInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).toBlocking().last().body(); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @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 createOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo), serviceCallback); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (topicInfo == null) { + throw new IllegalArgumentException("Parameter topicInfo 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(topicInfo); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, topicName, topicInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @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 TopicInner object if successful. + */ + public TopicInner beginCreateOrUpdate(String resourceGroupName, String topicName, TopicInner topicInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).toBlocking().single().body(); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo), serviceCallback); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicInfo Topic information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (topicInfo == null) { + throw new IllegalArgumentException("Parameter topicInfo 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(topicInfo); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, topicName, topicInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @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 + */ + public void delete(String resourceGroupName, String topicName) { + deleteWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().last().body(); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String topicName) { + return deleteWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @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 + */ + public void beginDelete(String resourceGroupName, String topicName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String topicName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @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 TopicInner object if successful. + */ + public TopicInner update(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).toBlocking().last().body(); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters), serviceCallback); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (topicUpdateParameters == null) { + throw new IllegalArgumentException("Parameter topicUpdateParameters 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(topicUpdateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, topicName, topicUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @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 TopicInner object if successful. + */ + public TopicInner beginUpdate(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).toBlocking().single().body(); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters), serviceCallback); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (topicUpdateParameters == null) { + throw new IllegalArgumentException("Parameter topicUpdateParameters 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(topicUpdateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, topicName, topicUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @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 PagedList<TopicInner> 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(); + } + }; + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> 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)); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, 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); + } + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<TopicInner> object if successful. + */ + public PagedList list(final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listAsync(final String filter, final Integer top) { + return listWithServiceResponseAsync(filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top) { + return listSinglePageAsync(filter, top) + .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)); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 PagedList<TopicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 PagedList<TopicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @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 TopicSharedAccessKeysInner object if successful. + */ + public TopicSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String topicName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @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 listSharedAccessKeysAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable listSharedAccessKeysAsync(String resourceGroupName, String topicName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, TopicSharedAccessKeysInner>() { + @Override + public TopicSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable> listSharedAccessKeysWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName 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.listSharedAccessKeys(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedAccessKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSharedAccessKeysDelegate(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); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param keyName Key name to regenerate key1 or key2 + * @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 TopicSharedAccessKeysInner object if successful. + */ + public TopicSharedAccessKeysInner regenerateKey(String resourceGroupName, String topicName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, topicName, keyName).toBlocking().single().body(); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param keyName Key name to regenerate key1 or key2 + * @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 regenerateKeyAsync(String resourceGroupName, String topicName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, topicName, keyName), serviceCallback); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String topicName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, topicName, keyName).map(new Func1, TopicSharedAccessKeysInner>() { + @Override + public TopicSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic. + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String topicName, String keyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + TopicRegenerateKeyRequest regenerateKeyRequest = new TopicRegenerateKeyRequest(); + regenerateKeyRequest.withKeyName(keyName); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateKeyRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(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); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the topic type. + * @param resourceName Name of the topic. + * @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 List<EventTypeInner> object if successful. + */ + public List listEventTypes(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body(); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the topic type. + * @param resourceName Name of the topic. + * @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> listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName), serviceCallback); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the topic type. + * @param resourceName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable> listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic. + * @param resourceTypeName Name of the topic type. + * @param resourceName Name of the topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable>> listEventTypesWithServiceResponseAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerNamespace == null) { + throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."); + } + if (resourceTypeName == null) { + throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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.listEventTypes(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventTypesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventTypesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<TopicInner> 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(); + } + }; + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> 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)); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<TopicInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/package-info.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/package-info.java new file mode 100644 index 000000000000..fe7356223970 --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for EventGridManagementClient. + * Azure EventGrid Management Client. + */ +package com.microsoft.azure.management.eventgrid.v2020_06_01.implementation; diff --git a/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/package-info.java b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/package-info.java new file mode 100644 index 000000000000..9f7ca871501f --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2020_06_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for EventGridManagementClient. + * Azure EventGrid Management Client. + */ +package com.microsoft.azure.management.eventgrid.v2020_06_01; diff --git a/sdk/eventgrid/pom.mgmt.xml b/sdk/eventgrid/pom.mgmt.xml index fd06db8b5b2f..6f327b1577e4 100644 --- a/sdk/eventgrid/pom.mgmt.xml +++ b/sdk/eventgrid/pom.mgmt.xml @@ -16,5 +16,6 @@ mgmt-v2019_06_01 mgmt-v2020_01_01_preview mgmt-v2020_04_01_preview + mgmt-v2020_06_01