diff --git a/eventgrid/resource-manager/v2019_01_01/pom.xml b/eventgrid/resource-manager/v2019_01_01/pom.xml new file mode 100644 index 0000000000000..14fd665c4356b --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.eventgrid.v2019_01_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../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 + + + + + + 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/DeadLetterDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/DeadLetterDestination.java new file mode 100644 index 0000000000000..c71e8daa37ab1 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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") +@JsonTypeName("DeadLetterDestination") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StorageBlob", value = StorageBlobDeadLetterDestination.class) +}) +public class DeadLetterDestination { +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventHubEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventHubEventSubscriptionDestination.java new file mode 100644 index 0000000000000..c17ff8bdfcaaf --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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") +@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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscription.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscription.java new file mode 100644 index 0000000000000..30087b1428014 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscription.java @@ -0,0 +1,243 @@ +/** + * 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.v2019_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2019_01_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.v2019_01_01.implementation.EventGridManager; +import java.util.List; + +/** + * 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 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 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.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.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 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionDestination.java new file mode 100644 index 0000000000000..2e3df95ced99b --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionDestination.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.v2019_01_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") +@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) +}) +public class EventSubscriptionDestination { +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionFilter.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionFilter.java new file mode 100644 index 0000000000000..703601cfb6365 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionFilter.java @@ -0,0 +1,142 @@ +/** + * 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.v2019_01_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 event types, the string "all" needs + * to be specified as an element in this list. + */ + @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; + + /** + * 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 event types, the string "all" needs to be specified as an element in this list. + * + * @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 event types, the string "all" needs to be specified as an element in this list. + * + * @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; + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionFullUrl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionFullUrl.java new file mode 100644 index 0000000000000..728401ef94515 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_01_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_01_01.implementation.EventSubscriptionFullUrlInner; + +/** + * Type representing EventSubscriptionFullUrl. + */ +public interface EventSubscriptionFullUrl extends HasInner, HasManager { + /** + * @return the endpointUrl value. + */ + String endpointUrl(); + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionProvisioningState.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionProvisioningState.java new file mode 100644 index 0000000000000..81aafa52d2e91 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionUpdateParameters.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionUpdateParameters.java new file mode 100644 index 0000000000000..4b6fef9ac023b --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptionUpdateParameters.java @@ -0,0 +1,150 @@ +/** + * 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.v2019_01_01; + +import java.util.List; +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; + + /** + * 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 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptions.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptions.java new file mode 100644 index 0000000000000..bcdae9c155c6f --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventSubscriptions.java @@ -0,0 +1,134 @@ +/** + * 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.v2019_01_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.v2019_01_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(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(String resourceGroupName, 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(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(String resourceGroupName, 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(String location, 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(String resourceGroupName, String location, 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(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName); + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventType.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventType.java new file mode 100644 index 0000000000000..08609b12e6e3b --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/EventType.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.v2019_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2019_01_01.implementation.EventTypeInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_01_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 name value. + */ + String name(); + + /** + * @return the schemaUrl value. + */ + String schemaUrl(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/HybridConnectionEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/HybridConnectionEventSubscriptionDestination.java new file mode 100644 index 0000000000000..fce1a977a2865 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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") +@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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Operation.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Operation.java new file mode 100644 index 0000000000000..e394c20b8f6d0 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_01_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/OperationInfo.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/OperationInfo.java new file mode 100644 index 0000000000000..68f7c0da86ea8 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Operations.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Operations.java new file mode 100644 index 0000000000000..de846ad09c19e --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01; + +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/ResourceRegionType.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/ResourceRegionType.java new file mode 100644 index 0000000000000..d085e36f6e520 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/RetryPolicy.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/RetryPolicy.java new file mode 100644 index 0000000000000..579611edc2e94 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java new file mode 100644 index 0000000000000..ad78db352eebd --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_01_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") +@JsonTypeName("StorageBlob") +@JsonFlatten +public class StorageBlobDeadLetterDestination extends DeadLetterDestination { + /** + * The Azure Resource ID of the storage blob container that is the + * destination of the deadletter events. For example: + * /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. + */ + @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 blob container that is the destination of the deadletter events. For example: /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of the storage blob container that is the destination of the deadletter events. For example: /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. + * + * @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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageQueueEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageQueueEventSubscriptionDestination.java new file mode 100644 index 0000000000000..6ba84f19322c6 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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") +@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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Topic.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Topic.java new file mode 100644 index 0000000000000..2bc12eedd796e --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Topic.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_01_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.v2019_01_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_01_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 provisioningState value. + */ + TopicProvisioningState provisioningState(); + + /** + * 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 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 { + } + } + /** + * The template for a Topic update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of Topic update stages. + */ + interface UpdateStages { + } +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicProvisioningState.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicProvisioningState.java new file mode 100644 index 0000000000000..59e8132249c88 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicRegenerateKeyRequest.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicRegenerateKeyRequest.java new file mode 100644 index 0000000000000..d1a0b6b35464e --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicSharedAccessKeys.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicSharedAccessKeys.java new file mode 100644 index 0000000000000..7b04df8be6c71 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_01_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypeInfo.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypeInfo.java new file mode 100644 index 0000000000000..e9f3734f39a9d --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypeInfo.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.v2019_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_01_01.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_01_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 supportedLocations value. + */ + List supportedLocations(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypeProvisioningState.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypeProvisioningState.java new file mode 100644 index 0000000000000..c1e3534b9c882 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypes.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicTypes.java new file mode 100644 index 0000000000000..290da0dbf1fa9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01; + +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicUpdateParameters.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicUpdateParameters.java new file mode 100644 index 0000000000000..5f34bf7f0d3c7 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/TopicUpdateParameters.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.v2019_01_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Topic update. + */ +public class TopicUpdateParameters { + /** + * Tags of the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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; + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Topics.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/Topics.java new file mode 100644 index 0000000000000..7e5cd04b8ab7f --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/WebHookEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/WebHookEventSubscriptionDestination.java new file mode 100644 index 0000000000000..c47c80abd191b --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/WebHookEventSubscriptionDestination.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.v2019_01_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") +@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; + + /** + * 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; + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventGridManagementClientImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventGridManagementClientImpl.java new file mode 100644 index 0000000000000..0e37ae4ac5b80 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventGridManagementClientImpl.java @@ -0,0 +1,238 @@ +/** + * 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.v2019_01_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 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 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 = "2019-01-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.eventSubscriptions = new EventSubscriptionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.topics = new TopicsInner(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", "2019-01-01"); + } +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventGridManager.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventGridManager.java new file mode 100644 index 0000000000000..d72633579c7a7 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventGridManager.java @@ -0,0 +1,135 @@ +/** + * 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.v2019_01_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.v2019_01_01.EventSubscriptions; +import com.microsoft.azure.management.eventgrid.v2019_01_01.Operations; +import com.microsoft.azure.management.eventgrid.v2019_01_01.Topics; +import com.microsoft.azure.management.eventgrid.v2019_01_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 EventSubscriptions eventSubscriptions; + private Operations operations; + private Topics topics; + 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 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 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionFullUrlImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionFullUrlImpl.java new file mode 100644 index 0000000000000..15c632157896d --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionFullUrlInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionFullUrlInner.java new file mode 100644 index 0000000000000..c3b9cf76ed4cf --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionImpl.java new file mode 100644 index 0000000000000..7de0c2cede5fe --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionImpl.java @@ -0,0 +1,205 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionFilter; +import com.microsoft.azure.management.eventgrid.v2019_01_01.RetryPolicy; +import com.microsoft.azure.management.eventgrid.v2019_01_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 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 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionInner.java new file mode 100644 index 0000000000000..6d08216570639 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionInner.java @@ -0,0 +1,190 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptionFilter; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_01_01.RetryPolicy; +import com.microsoft.azure.management.eventgrid.v2019_01_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; + + /** + * 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 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionsImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionsImpl.java new file mode 100644 index 0000000000000..e6737fe673956 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionsImpl.java @@ -0,0 +1,260 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscriptions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import rx.Completable; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventSubscription; +import com.microsoft.azure.management.eventgrid.v2019_01_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(String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listGlobalBySubscriptionForTopicTypeAsync(topicTypeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listGlobalByResourceGroupForTopicTypeAsync(String resourceGroupName, String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listGlobalByResourceGroupForTopicTypeAsync(resourceGroupName, topicTypeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalBySubscriptionAsync(String location) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalBySubscriptionAsync(location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalByResourceGroupAsync(String resourceGroupName, String location) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalByResourceGroupAsync(resourceGroupName, location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalBySubscriptionForTopicTypeAsync(String location, String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalBySubscriptionForTopicTypeAsync(location, topicTypeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalByResourceGroupForTopicTypeAsync(String resourceGroupName, String location, String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalByResourceGroupForTopicTypeAsync(resourceGroupName, location, topicTypeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + EventSubscriptionsInner client = this.inner(); + return client.listByResourceAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .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() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.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) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionsInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionsInner.java new file mode 100644 index 0000000000000..4c381adf503b8 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventSubscriptionsInner.java @@ -0,0 +1,1662 @@ +/** + * 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.v2019_01_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.CloudException; +import com.microsoft.azure.management.eventgrid.v2019_01_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.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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_01.EventSubscriptions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_01_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, @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.v2019_01_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, @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.v2019_01_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, @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.v2019_01_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, @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.v2019_01_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, @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.v2019_01_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, @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.v2019_01_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, @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.v2019_01_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, @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. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), 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. + * + * @return the observable to the List<EventSubscriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @return the observable to the List<EventSubscriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + 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); + } + + /** + * 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 List<EventSubscriptionInner> object if successful. + */ + public List listGlobalBySubscriptionForTopicType(String topicTypeName) { + return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName).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(String topicTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName), 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 List<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeAsync(String topicTypeName) { + return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(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."); + } + return service.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeDelegate(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> 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. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), 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. + * @return the observable to the List<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * 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. + * @return the observable to the List<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(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."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(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> 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 List<EventSubscriptionInner> object if successful. + */ + public List listGlobalByResourceGroupForTopicType(String resourceGroupName, String topicTypeName) { + return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName).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(String resourceGroupName, String topicTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName), 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 List<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeAsync(String resourceGroupName, String topicTypeName) { + return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(String resourceGroupName, 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."); + } + return service.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeDelegate(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> 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 List<EventSubscriptionInner> object if successful. + */ + public List listRegionalBySubscription(String location) { + return listRegionalBySubscriptionWithServiceResponseAsync(location).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(String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listRegionalBySubscriptionWithServiceResponseAsync(location), 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 List<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionAsync(String location) { + return listRegionalBySubscriptionWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionWithServiceResponseAsync(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."); + } + return service.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionDelegate(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> 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 List<EventSubscriptionInner> object if successful. + */ + public List listRegionalByResourceGroup(String resourceGroupName, String location) { + return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location).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(String resourceGroupName, String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location), 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 List<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupAsync(String resourceGroupName, String location) { + return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupWithServiceResponseAsync(String resourceGroupName, 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."); + } + return service.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupDelegate(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> 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 List<EventSubscriptionInner> object if successful. + */ + public List listRegionalBySubscriptionForTopicType(String location, String topicTypeName) { + return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName).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(String location, String topicTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName), 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 List<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeAsync(String location, String topicTypeName) { + return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(String location, 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."); + } + return service.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeDelegate(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> 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 List<EventSubscriptionInner> object if successful. + */ + public List listRegionalByResourceGroupForTopicType(String resourceGroupName, String location, String topicTypeName) { + return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName).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(String resourceGroupName, String location, String topicTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName), 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 List<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeAsync(String resourceGroupName, String location, String topicTypeName) { + return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(String resourceGroupName, String location, 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."); + } + return service.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeDelegate(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> 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 List<EventSubscriptionInner> object if successful. + */ + public List listByResource(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).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(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName), 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 List<EventSubscriptionInner> object + */ + public Observable> listByResourceAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).map(new Func1>, List>() { + @Override + public List 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 List<EventSubscriptionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(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.listByResource(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 = listByResourceDelegate(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> 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); + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventTypeImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventTypeImpl.java new file mode 100644 index 0000000000000..c8d55765ca911 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventTypeImpl.java @@ -0,0 +1,60 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_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 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventTypeInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventTypeInner.java new file mode 100644 index 0000000000000..4a33155216bc9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/EventTypeInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_01_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; + + /** + * 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; + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/IdParsingUtils.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ca9f05f61b2aa --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..55a987e943885 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..c3ed7dbb52897 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationsImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..d9e985fa1e517 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationsInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..9c2316f1b59e9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/PageImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..c1faa8611514d --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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("") + 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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicImpl.java new file mode 100644 index 0000000000000..0a915f59b3bc1 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicImpl.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.v2019_01_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_01.Topic; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_01_01.TopicProvisioningState; + +class TopicImpl extends GroupableResourceCoreImpl implements Topic, Topic.Definition, Topic.Update { + TopicImpl(String name, TopicInner inner, EventGridManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .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; + } + + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public TopicProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicInner.java new file mode 100644 index 0000000000000..b2a2a71b652bf --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicInner.java @@ -0,0 +1,52 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_01.TopicProvisioningState; +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 { + /** + * 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; + + /** + * 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; + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicSharedAccessKeysImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicSharedAccessKeysImpl.java new file mode 100644 index 0000000000000..51a9c142c283f --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicSharedAccessKeysInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicSharedAccessKeysInner.java new file mode 100644 index 0000000000000..352ba413b6b97 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypeInfoImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypeInfoImpl.java new file mode 100644 index 0000000000000..5bb70313852da --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypeInfoImpl.java @@ -0,0 +1,74 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_01.TopicTypeInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_01.TopicTypeProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_01_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 List supportedLocations() { + return this.inner().supportedLocations(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypeInfoInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypeInfoInner.java new file mode 100644 index 0000000000000..ebe461b1ce90e --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypeInfoInner.java @@ -0,0 +1,181 @@ +/** + * 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.v2019_01_01.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_01_01.ResourceRegionType; +import com.microsoft.azure.management.eventgrid.v2019_01_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; + + /** + * 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; + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypesImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypesImpl.java new file mode 100644 index 0000000000000..9bfa220473926 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_01.TopicTypes; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_01_01.EventType; +import com.microsoft.azure.management.eventgrid.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypesInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicTypesInner.java new file mode 100644 index 0000000000000..24fe75c5a084e --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsImpl.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsImpl.java new file mode 100644 index 0000000000000..d49f6cde2a662 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.eventgrid.v2019_01_01.Topics; +import com.microsoft.azure.management.eventgrid.v2019_01_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.v2019_01_01.TopicSharedAccessKeys; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_01_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) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.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() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.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/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java new file mode 100644 index 0000000000000..70fb324f06c4a --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java @@ -0,0 +1,1363 @@ +/** + * 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.v2019_01_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.CloudException; +import com.microsoft.azure.management.eventgrid.v2019_01_01.TopicRegenerateKeyRequest; +import com.microsoft.azure.management.eventgrid.v2019_01_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 java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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.v2019_01_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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicUpdateParameters topicUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_01_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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicUpdateParameters topicUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_01_01.Topics list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_01_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, @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.v2019_01_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.v2019_01_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.v2019_01_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); + + } + + /** + * 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 + * @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) { + return updateWithServiceResponseAsync(resourceGroupName, topicName).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, topicName), 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String topicName) { + return updateWithServiceResponseAsync(resourceGroupName, topicName).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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(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."); + } + final Map tags = null; + TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); + topicUpdateParameters.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, 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 tags Tags 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 TopicInner object if successful. + */ + public TopicInner update(String resourceGroupName, String topicName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, topicName, tags).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 tags Tags 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 updateAsync(String resourceGroupName, String topicName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, topicName, tags), 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 tags Tags of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String topicName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, topicName, tags).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 tags Tags of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String topicName, Map tags) { + 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."); + } + Validator.validate(tags); + TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); + topicUpdateParameters.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, 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 + * @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) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, topicName), 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String topicName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName).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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(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."); + } + final Map tags = null; + TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); + topicUpdateParameters.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, 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); + } + } + }); + } + + /** + * 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 tags Tags 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 TopicInner object if successful. + */ + public TopicInner beginUpdate(String resourceGroupName, String topicName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags).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 tags Tags 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 beginUpdateAsync(String resourceGroupName, String topicName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags), 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 tags Tags of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String topicName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags).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 tags Tags of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, Map tags) { + 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."); + } + Validator.validate(tags); + TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); + topicUpdateParameters.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, 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); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @return the observable to the List<TopicInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @return the observable to the List<TopicInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + 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); + } + + /** + * 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. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), 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. + * @return the observable to the List<TopicInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * 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. + * @return the observable to the List<TopicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(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."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(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> 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); + } + +} diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/package-info.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/package-info.java new file mode 100644 index 0000000000000..06a3ef4062832 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01.implementation; diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/package-info.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/package-info.java new file mode 100644 index 0000000000000..1a22c1375a6f7 --- /dev/null +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_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.v2019_01_01;