diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventHubEventSubscriptionDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventHubEventSubscriptionDestination.java new file mode 100644 index 00000000000..929c142c532 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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 resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.java new file mode 100644 index 00000000000..9208045c1b6 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.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; + +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) +}) +public class EventSubscriptionDestination { +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionFilter.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionFilter.java new file mode 100644 index 00000000000..5017b957f8b --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionFilter.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +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 the subjectBeginsWith value. + * + * @return the subjectBeginsWith value + */ + public String subjectBeginsWith() { + return this.subjectBeginsWith; + } + + /** + * Set the subjectBeginsWith value. + * + * @param subjectBeginsWith the subjectBeginsWith value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withSubjectBeginsWith(String subjectBeginsWith) { + this.subjectBeginsWith = subjectBeginsWith; + return this; + } + + /** + * Get the subjectEndsWith value. + * + * @return the subjectEndsWith value + */ + public String subjectEndsWith() { + return this.subjectEndsWith; + } + + /** + * Set the subjectEndsWith value. + * + * @param subjectEndsWith the subjectEndsWith value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withSubjectEndsWith(String subjectEndsWith) { + this.subjectEndsWith = subjectEndsWith; + return this; + } + + /** + * Get the includedEventTypes value. + * + * @return the includedEventTypes value + */ + public List includedEventTypes() { + return this.includedEventTypes; + } + + /** + * Set the includedEventTypes value. + * + * @param includedEventTypes the includedEventTypes value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withIncludedEventTypes(List includedEventTypes) { + this.includedEventTypes = includedEventTypes; + return this; + } + + /** + * Get the isSubjectCaseSensitive value. + * + * @return the isSubjectCaseSensitive value + */ + public Boolean isSubjectCaseSensitive() { + return this.isSubjectCaseSensitive; + } + + /** + * Set the isSubjectCaseSensitive value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.java new file mode 100644 index 00000000000..55b5a7a7dab --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.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; + +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"); + + /** + * 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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/OperationInfo.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/OperationInfo.java new file mode 100644 index 00000000000..7b7a93dafd3 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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 the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @param resource the resource value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation value. + * + * @param operation the operation value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/ResourceRegionType.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/ResourceRegionType.java new file mode 100644 index 00000000000..cdc471a3fc3 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicProvisioningState.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicProvisioningState.java new file mode 100644 index 00000000000..43c6a873caa --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicRegenerateKeyRequest.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicRegenerateKeyRequest.java new file mode 100644 index 00000000000..afa4711c260 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topic regenerate share access key key request. + */ +public class TopicRegenerateKeyRequest { + /** + * Key name to regenerate key1 or key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the keyName value. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicTypeProvisioningState.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicTypeProvisioningState.java new file mode 100644 index 00000000000..e2a1fd77893 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicUpdateParameters.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicUpdateParameters.java new file mode 100644 index 00000000000..ab15914a116 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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 the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/WebHookEventSubscriptionDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/WebHookEventSubscriptionDestination.java new file mode 100644 index 00000000000..598e42eb634 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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; + +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 endpointUrl value. + * + * @return the endpointUrl value + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl value. + * + * @param endpointUrl the endpointUrl value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Get the endpointBaseUrl value. + * + * @return the endpointBaseUrl value + */ + public String endpointBaseUrl() { + return this.endpointBaseUrl; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventGridManagementClientImpl.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventGridManagementClientImpl.java new file mode 100644 index 00000000000..1ecc48968f5 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.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; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public EventGridManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public EventGridManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public 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 = "2018-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)", super.userAgent(), "EventGridManagementClient", "2018-01-01"); + } +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionFullUrlInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionFullUrlInner.java new file mode 100644 index 00000000000..33df1b993ff --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.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 endpointUrl value. + * + * @return the endpointUrl value + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.java new file mode 100644 index 00000000000..0d1e3cec7fb --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.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.implementation; + +import com.microsoft.azure.management.eventgrid.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.EventSubscriptionFilter; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Event Subscription. + */ +@JsonFlatten +public class EventSubscriptionInner extends Resource { + /** + * 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'. + */ + @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; + + /** + * Get the topic value. + * + * @return the topic value + */ + public String topic() { + return this.topic; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public EventSubscriptionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the filter value. + * + * @return the filter value + */ + public EventSubscriptionFilter filter() { + return this.filter; + } + + /** + * Set the filter value. + * + * @param filter the filter value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withFilter(EventSubscriptionFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the labels value. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels value. + * + * @param labels the labels value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withLabels(List labels) { + this.labels = labels; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java new file mode 100644 index 00000000000..f1e42d56af9 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.implementation; + +import com.microsoft.azure.management.eventgrid.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.EventSubscriptionFilter; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Event Subscription update. + */ +public class EventSubscriptionUpdateParametersInner { + /** + * 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; + + /** + * Get the destination value. + * + * @return the destination value + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the EventSubscriptionUpdateParametersInner object itself. + */ + public EventSubscriptionUpdateParametersInner withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the filter value. + * + * @return the filter value + */ + public EventSubscriptionFilter filter() { + return this.filter; + } + + /** + * Set the filter value. + * + * @param filter the filter value to set + * @return the EventSubscriptionUpdateParametersInner object itself. + */ + public EventSubscriptionUpdateParametersInner withFilter(EventSubscriptionFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the labels value. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels value. + * + * @param labels the labels value to set + * @return the EventSubscriptionUpdateParametersInner object itself. + */ + public EventSubscriptionUpdateParametersInner withLabels(List labels) { + this.labels = labels; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java new file mode 100644 index 00000000000..bcf375bed29 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java @@ -0,0 +1,1625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.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.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.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.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.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.EventSubscriptions update" }) + @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> update(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParametersInner 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.EventSubscriptions beginUpdate" }) + @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> beginUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParametersInner 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.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.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.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.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.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.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.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.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.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.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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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 created + * @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, EventSubscriptionUpdateParametersInner 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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventTypeInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventTypeInner.java new file mode 100644 index 00000000000..3a59a47e1af --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Event Type for a subject under a topic. + */ +@JsonFlatten +public class EventTypeInner extends Resource { + /** + * 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 the displayName value. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName value. + * + * @param displayName the displayName value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the schemaUrl value. + * + * @return the schemaUrl value + */ + public String schemaUrl() { + return this.schemaUrl; + } + + /** + * Set the schemaUrl value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/OperationInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/OperationInner.java new file mode 100644 index 00000000000..1d43815938a --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.implementation; + +import com.microsoft.azure.management.eventgrid.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 the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationInfo display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationInfo display) { + this.display = display; + return this; + } + + /** + * Get the origin value. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin value. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/OperationsInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/OperationsInner.java new file mode 100644 index 00000000000..37fd4ec1458 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/OperationsInner.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.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.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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/PageImpl.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/PageImpl.java new file mode 100644 index 00000000000..dcd4ad23e85 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.java new file mode 100644 index 00000000000..7f37d766e79 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.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.implementation; + +import com.microsoft.azure.management.eventgrid.TopicProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * EventGrid Topic. + */ +@JsonFlatten +public class TopicInner extends TrackedResourceInner { + /** + * 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 the provisioningState value. + * + * @return the provisioningState value + */ + public TopicProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the endpoint value. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicSharedAccessKeysInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicSharedAccessKeysInner.java new file mode 100644 index 00000000000..2b1963aab81 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.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 the key1 value. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set the key1 value. + * + * @param key1 the key1 value to set + * @return the TopicSharedAccessKeysInner object itself. + */ + public TopicSharedAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get the key2 value. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set the key2 value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicTypeInfoInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicTypeInfoInner.java new file mode 100644 index 00000000000..02b55c81c10 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.implementation; + +import com.microsoft.azure.management.eventgrid.ResourceRegionType; +import com.microsoft.azure.management.eventgrid.TopicTypeProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Properties of a topic type info. + */ +@JsonFlatten +public class TopicTypeInfoInner extends Resource { + /** + * 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 the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the displayName value. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName value. + * + * @param displayName the displayName value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the resourceRegionType value. + * + * @return the resourceRegionType value + */ + public ResourceRegionType resourceRegionType() { + return this.resourceRegionType; + } + + /** + * Set the resourceRegionType value. + * + * @param resourceRegionType the resourceRegionType value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withResourceRegionType(ResourceRegionType resourceRegionType) { + this.resourceRegionType = resourceRegionType; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public TopicTypeProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withProvisioningState(TopicTypeProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the supportedLocations value. + * + * @return the supportedLocations value + */ + public List supportedLocations() { + return this.supportedLocations; + } + + /** + * Set the supportedLocations value. + * + * @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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicTypesInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicTypesInner.java new file mode 100644 index 00000000000..e5101873bde --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicTypesInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.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.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.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.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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicsInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicsInner.java new file mode 100644 index 00000000000..0766518a06d --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicsInner.java @@ -0,0 +1,1351 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.eventgrid.TopicRegenerateKeyRequest; +import com.microsoft.azure.management.eventgrid.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.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.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.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.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.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.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.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.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.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.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.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.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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().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/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TrackedResourceInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TrackedResourceInner.java new file mode 100644 index 00000000000..328f99957f0 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TrackedResourceInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Definition of a Tracked Resource. + */ +public class TrackedResourceInner extends Resource { + /** + * Location of the resource. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Tags of the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/package-info.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/package-info.java new file mode 100644 index 00000000000..cb20e48b668 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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.implementation; diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/package-info.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/package-info.java new file mode 100644 index 00000000000..0a0cfb27c0b --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/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;