From 15659c76cf7db0e5c9dedef679ba4014112d5993 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 17 May 2019 05:32:35 +0000 Subject: [PATCH] Generated from c6e4afda25e5e2474198f5e668afc8e3383e3b31 EventGrid: Swagger work for 2019-06-01 Api Version --- .../resource-manager/v2018_01_01/pom.xml | 2 +- .../v2018_05_01_preview/pom.xml | 2 +- .../v2018_09_15_preview/pom.xml | 2 +- .../resource-manager/v2019_01_01/pom.xml | 4 +- .../StorageBlobDeadLetterDestination.java | 8 +- .../v2019_02_01_preview/pom.xml | 133 + .../v2019_02_01_preview/AdvancedFilter.java | 66 + .../BoolEqualsAdvancedFilter.java | 47 + .../DeadLetterDestination.java | 28 + .../eventgrid/v2019_02_01_preview/Domain.java | 136 + .../DomainProvisioningState.java | 53 + .../DomainRegenerateKeyRequest.java | 43 + .../DomainSharedAccessKeys.java | 30 + .../v2019_02_01_preview/DomainTopic.java | 93 + .../DomainTopicProvisioningState.java | 53 + .../v2019_02_01_preview/DomainTopics.java | 56 + .../DomainUpdateParameters.java | 44 + .../v2019_02_01_preview/Domains.java | 48 + .../EventDeliverySchema.java | 44 + .../EventHubEventSubscriptionDestination.java | 50 + .../EventSubscription.java | 302 ++ .../EventSubscriptionDestination.java | 28 + .../EventSubscriptionFilter.java | 166 + .../EventSubscriptionFullUrl.java | 25 + .../EventSubscriptionProvisioningState.java | 56 + .../EventSubscriptionUpdateParameters.java | 204 + .../EventSubscriptions.java | 146 + .../v2019_02_01_preview/EventType.java | 55 + ...onnectionEventSubscriptionDestination.java | 51 + .../v2019_02_01_preview/InputSchema.java | 44 + .../InputSchemaMapping.java | 27 + .../v2019_02_01_preview/JsonField.java | 47 + .../JsonFieldWithDefault.java | 79 + .../JsonInputSchemaMapping.java | 185 + .../NumberGreaterThanAdvancedFilter.java | 47 + ...mberGreaterThanOrEqualsAdvancedFilter.java | 47 + .../NumberInAdvancedFilter.java | 48 + .../NumberLessThanAdvancedFilter.java | 47 + .../NumberLessThanOrEqualsAdvancedFilter.java | 47 + .../NumberNotInAdvancedFilter.java | 48 + .../v2019_02_01_preview/Operation.java | 40 + .../v2019_02_01_preview/OperationInfo.java | 121 + .../v2019_02_01_preview/Operations.java | 28 + .../ResourceRegionType.java | 41 + .../v2019_02_01_preview/RetryPolicy.java | 69 + ...eBusQueueEventSubscriptionDestination.java | 50 + .../StorageBlobDeadLetterDestination.java | 77 + ...rageQueueEventSubscriptionDestination.java | 77 + .../StringBeginsWithAdvancedFilter.java | 48 + .../StringContainsAdvancedFilter.java | 48 + .../StringEndsWithAdvancedFilter.java | 48 + .../StringInAdvancedFilter.java | 48 + .../StringNotInAdvancedFilter.java | 48 + .../eventgrid/v2019_02_01_preview/Topic.java | 136 + .../TopicProvisioningState.java | 53 + .../TopicRegenerateKeyRequest.java | 43 + .../TopicSharedAccessKeys.java | 30 + .../v2019_02_01_preview/TopicTypeInfo.java | 66 + .../TopicTypeProvisioningState.java | 53 + .../v2019_02_01_preview/TopicTypes.java | 48 + .../TopicUpdateParameters.java | 44 + .../eventgrid/v2019_02_01_preview/Topics.java | 61 + .../WebHookEventSubscriptionDestination.java | 66 + .../implementation/DomainImpl.java | 81 + .../implementation/DomainInner.java | 109 + .../DomainSharedAccessKeysImpl.java | 36 + .../DomainSharedAccessKeysInner.java | 69 + .../implementation/DomainTopicImpl.java | 100 + .../implementation/DomainTopicInner.java | 48 + .../implementation/DomainTopicsImpl.java | 81 + .../implementation/DomainTopicsInner.java | 919 ++++ .../implementation/DomainsImpl.java | 163 + .../implementation/DomainsInner.java | 1790 +++++++ .../EventGridManagementClientImpl.java | 266 + .../implementation/EventGridManager.java | 159 + .../EventSubscriptionFullUrlImpl.java | 31 + .../EventSubscriptionFullUrlInner.java | 44 + .../implementation/EventSubscriptionImpl.java | 237 + .../EventSubscriptionInner.java | 245 + .../EventSubscriptionsImpl.java | 277 + .../EventSubscriptionsInner.java | 4674 +++++++++++++++++ .../implementation/EventTypeImpl.java | 65 + .../implementation/EventTypeInner.java | 124 + .../implementation/IdParsingUtils.java | 57 + .../implementation/OperationImpl.java | 47 + .../implementation/OperationInner.java | 122 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 138 + .../implementation/PageImpl.java | 75 + .../implementation/PageImpl1.java | 75 + .../implementation/TopicImpl.java | 81 + .../implementation/TopicInner.java | 111 + .../TopicSharedAccessKeysImpl.java | 36 + .../TopicSharedAccessKeysInner.java | 69 + .../implementation/TopicTypeInfoImpl.java | 74 + .../implementation/TopicTypeInfoInner.java | 181 + .../implementation/TopicTypesImpl.java | 84 + .../implementation/TopicTypesInner.java | 312 ++ .../implementation/TopicsImpl.java | 183 + .../implementation/TopicsInner.java | 1903 +++++++ .../implementation/package-info.java | 11 + .../v2019_02_01_preview/package-info.java | 11 + 102 files changed, 17112 insertions(+), 9 deletions(-) create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/pom.xml create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/AdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/BoolEqualsAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DeadLetterDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domain.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainProvisioningState.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainRegenerateKeyRequest.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainSharedAccessKeys.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopic.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopicProvisioningState.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopics.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainUpdateParameters.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domains.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventDeliverySchema.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventHubEventSubscriptionDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscription.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFullUrl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionProvisioningState.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionUpdateParameters.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptions.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventType.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/HybridConnectionEventSubscriptionDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchema.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchemaMapping.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonField.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonFieldWithDefault.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonInputSchemaMapping.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanOrEqualsAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberInAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanOrEqualsAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberNotInAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operation.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/OperationInfo.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operations.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ResourceRegionType.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/RetryPolicy.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ServiceBusQueueEventSubscriptionDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageBlobDeadLetterDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageQueueEventSubscriptionDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringBeginsWithAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringContainsAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringEndsWithAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringInAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringNotInAdvancedFilter.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topic.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicProvisioningState.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicRegenerateKeyRequest.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicSharedAccessKeys.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeInfo.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeProvisioningState.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypes.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicUpdateParameters.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topics.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/WebHookEventSubscriptionDestination.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManagementClientImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManager.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/IdParsingUtils.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl1.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsImpl.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsInner.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/package-info.java create mode 100644 eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/package-info.java diff --git a/eventgrid/resource-manager/v2018_01_01/pom.xml b/eventgrid/resource-manager/v2018_01_01/pom.xml index 68fbf173491bb..16dcc12a24dd6 100644 --- a/eventgrid/resource-manager/v2018_01_01/pom.xml +++ b/eventgrid/resource-manager/v2018_01_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-eventgrid diff --git a/eventgrid/resource-manager/v2018_05_01_preview/pom.xml b/eventgrid/resource-manager/v2018_05_01_preview/pom.xml index 1f86ced2e9c68..7139a5fbcfca4 100644 --- a/eventgrid/resource-manager/v2018_05_01_preview/pom.xml +++ b/eventgrid/resource-manager/v2018_05_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-eventgrid diff --git a/eventgrid/resource-manager/v2018_09_15_preview/pom.xml b/eventgrid/resource-manager/v2018_09_15_preview/pom.xml index 547ff55383216..98f2a9f9f264b 100644 --- a/eventgrid/resource-manager/v2018_09_15_preview/pom.xml +++ b/eventgrid/resource-manager/v2018_09_15_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-eventgrid diff --git a/eventgrid/resource-manager/v2019_01_01/pom.xml b/eventgrid/resource-manager/v2019_01_01/pom.xml index 2840bc413103c..0c3fc8bf038a6 100644 --- a/eventgrid/resource-manager/v2019_01_01/pom.xml +++ b/eventgrid/resource-manager/v2019_01_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-eventgrid - 1.0.0 + 1.0.0-beta jar Microsoft Azure SDK for EventGrid Management This package contains Microsoft EventGrid Management SDK. diff --git a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java index ad78db352eebd..3aa06cb065048 100644 --- a/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java +++ b/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/StorageBlobDeadLetterDestination.java @@ -21,8 +21,8 @@ @JsonFlatten public class StorageBlobDeadLetterDestination extends DeadLetterDestination { /** - * The Azure Resource ID of the storage blob container that is the - * destination of the deadletter events. For example: + * The Azure Resource ID of the storage account that is the destination of + * the deadletter events. For example: * /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. */ @JsonProperty(value = "properties.resourceId") @@ -36,7 +36,7 @@ public class StorageBlobDeadLetterDestination extends DeadLetterDestination { private String blobContainerName; /** - * Get the Azure Resource ID of the storage blob container that is the destination of the deadletter events. For example: /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. + * Get the Azure Resource ID of the storage account that is the destination of the deadletter events. For example: /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. * * @return the resourceId value */ @@ -45,7 +45,7 @@ public String resourceId() { } /** - * Set the Azure Resource ID of the storage blob container that is the destination of the deadletter events. For example: /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. + * Set the Azure Resource ID of the storage account that is the destination of the deadletter events. For example: /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.Storage/storageAccounts/{StorageAccountName}. * * @param resourceId the resourceId value to set * @return the StorageBlobDeadLetterDestination object itself. diff --git a/eventgrid/resource-manager/v2019_02_01_preview/pom.xml b/eventgrid/resource-manager/v2019_02_01_preview/pom.xml new file mode 100644 index 0000000000000..76528ca8f5d4d --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.eventgrid.v2019_02_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-eventgrid + 1.0.0-beta + jar + Microsoft Azure SDK for EventGrid Management + This package contains Microsoft EventGrid Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/AdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/AdvancedFilter.java new file mode 100644 index 0000000000000..f9a28bc2315cf --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/AdvancedFilter.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This is the base type that represents an advanced filter. To configure an + * advanced filter, do not directly instantiate an object of this class. + * Instead, instantiate an object of a derived class such as + * BoolEqualsAdvancedFilter, NumberInAdvancedFilter, StringEqualsAdvancedFilter + * etc. depending on the type of the key based on which you want to filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("AdvancedFilter") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "NumberIn", value = NumberInAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberNotIn", value = NumberNotInAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberLessThan", value = NumberLessThanAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberGreaterThan", value = NumberGreaterThanAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberLessThanOrEquals", value = NumberLessThanOrEqualsAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberGreaterThanOrEquals", value = NumberGreaterThanOrEqualsAdvancedFilter.class), + @JsonSubTypes.Type(name = "BoolEquals", value = BoolEqualsAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringIn", value = StringInAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringNotIn", value = StringNotInAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringBeginsWith", value = StringBeginsWithAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringEndsWith", value = StringEndsWithAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringContains", value = StringContainsAdvancedFilter.class) +}) +public class AdvancedFilter { + /** + * The field/property in the event based on which you want to filter. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the field/property in the event based on which you want to filter. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the field/property in the event based on which you want to filter. + * + * @param key the key value to set + * @return the AdvancedFilter object itself. + */ + public AdvancedFilter withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/BoolEqualsAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/BoolEqualsAdvancedFilter.java new file mode 100644 index 0000000000000..13fa898dd0c3a --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/BoolEqualsAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BoolEquals Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("BoolEquals") +public class BoolEqualsAdvancedFilter extends AdvancedFilter { + /** + * The boolean filter value. + */ + @JsonProperty(value = "value") + private Boolean value; + + /** + * Get the boolean filter value. + * + * @return the value value + */ + public Boolean value() { + return this.value; + } + + /** + * Set the boolean filter value. + * + * @param value the value value to set + * @return the BoolEqualsAdvancedFilter object itself. + */ + public BoolEqualsAdvancedFilter withValue(Boolean value) { + this.value = value; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DeadLetterDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DeadLetterDestination.java new file mode 100644 index 0000000000000..f12a9e134f34c --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DeadLetterDestination.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the dead letter destination for an event subscription. To + * configure a deadletter destination, do not directly instantiate an object of + * this class. Instead, instantiate an object of a derived class. Currently, + * StorageBlobDeadLetterDestination is the only class that derives from this + * class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("DeadLetterDestination") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StorageBlob", value = StorageBlobDeadLetterDestination.class) +}) +public class DeadLetterDestination { +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domain.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domain.java new file mode 100644 index 0000000000000..6b3bd109d2d80 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domain.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.DomainInner; + +/** + * Type representing Domain. + */ +public interface Domain extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the inputSchema value. + */ + InputSchema inputSchema(); + + /** + * @return the inputSchemaMapping value. + */ + InputSchemaMapping inputSchemaMapping(); + + /** + * @return the provisioningState value. + */ + DomainProvisioningState provisioningState(); + + /** + * The entirety of the Domain definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Domain definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Domain definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Domain definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the domain definition allowing to specify InputSchema. + */ + interface WithInputSchema { + /** + * Specifies inputSchema. + * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + * @return the next definition stage + */ + WithCreate withInputSchema(InputSchema inputSchema); + } + + /** + * The stage of the domain definition allowing to specify InputSchemaMapping. + */ + interface WithInputSchemaMapping { + /** + * Specifies inputSchemaMapping. + * @param inputSchemaMapping Information about the InputSchemaMapping which specified the info about mapping event payload + * @return the next definition stage + */ + WithCreate withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping { + } + } + /** + * The template for a Domain update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithInputSchema, UpdateStages.WithInputSchemaMapping { + } + + /** + * Grouping of Domain update stages. + */ + interface UpdateStages { + /** + * The stage of the domain update allowing to specify InputSchema. + */ + interface WithInputSchema { + /** + * Specifies inputSchema. + * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + * @return the next update stage + */ + Update withInputSchema(InputSchema inputSchema); + } + + /** + * The stage of the domain update allowing to specify InputSchemaMapping. + */ + interface WithInputSchemaMapping { + /** + * Specifies inputSchemaMapping. + * @param inputSchemaMapping Information about the InputSchemaMapping which specified the info about mapping event payload + * @return the next update stage + */ + Update withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); + } + + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainProvisioningState.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainProvisioningState.java new file mode 100644 index 0000000000000..502d5d00a1c21 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DomainProvisioningState. + */ +public final class DomainProvisioningState extends ExpandableStringEnum { + /** Static value Creating for DomainProvisioningState. */ + public static final DomainProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DomainProvisioningState. */ + public static final DomainProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for DomainProvisioningState. */ + public static final DomainProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for DomainProvisioningState. */ + public static final DomainProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for DomainProvisioningState. */ + public static final DomainProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for DomainProvisioningState. */ + public static final DomainProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DomainProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding DomainProvisioningState + */ + @JsonCreator + public static DomainProvisioningState fromString(String name) { + return fromString(name, DomainProvisioningState.class); + } + + /** + * @return known DomainProvisioningState values + */ + public static Collection values() { + return values(DomainProvisioningState.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainRegenerateKeyRequest.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainRegenerateKeyRequest.java new file mode 100644 index 0000000000000..ecadb248da21e --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainRegenerateKeyRequest.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Domain regenerate share access key request. + */ +public class DomainRegenerateKeyRequest { + /** + * Key name to regenerate key1 or key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get key name to regenerate key1 or key2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set key name to regenerate key1 or key2. + * + * @param keyName the keyName value to set + * @return the DomainRegenerateKeyRequest object itself. + */ + public DomainRegenerateKeyRequest withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainSharedAccessKeys.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainSharedAccessKeys.java new file mode 100644 index 0000000000000..47b6575f667e7 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainSharedAccessKeys.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.DomainSharedAccessKeysInner; + +/** + * Type representing DomainSharedAccessKeys. + */ +public interface DomainSharedAccessKeys extends HasInner, HasManager { + /** + * @return the key1 value. + */ + String key1(); + + /** + * @return the key2 value. + */ + String key2(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopic.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopic.java new file mode 100644 index 0000000000000..f61bc4f53aa11 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopic.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.DomainTopicInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; + +/** + * Type representing DomainTopic. + */ +public interface DomainTopic extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + DomainTopicProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DomainTopic definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDomain, DefinitionStages.WithCreate { + } + + /** + * Grouping of DomainTopic definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DomainTopic definition. + */ + interface Blank extends WithDomain { + } + + /** + * The stage of the domaintopic definition allowing to specify Domain. + */ + interface WithDomain { + /** + * Specifies resourceGroupName, domainName. + * @param resourceGroupName The name of the resource group within the user's subscription + * @param domainName Name of the domain + * @return the next definition stage + */ + WithCreate withExistingDomain(String resourceGroupName, String domainName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a DomainTopic update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of DomainTopic update stages. + */ + interface UpdateStages { + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopicProvisioningState.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopicProvisioningState.java new file mode 100644 index 0000000000000..fa5c651ae4074 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopicProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DomainTopicProvisioningState. + */ +public final class DomainTopicProvisioningState extends ExpandableStringEnum { + /** Static value Creating for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for DomainTopicProvisioningState. */ + public static final DomainTopicProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DomainTopicProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding DomainTopicProvisioningState + */ + @JsonCreator + public static DomainTopicProvisioningState fromString(String name) { + return fromString(name, DomainTopicProvisioningState.class); + } + + /** + * @return known DomainTopicProvisioningState values + */ + public static Collection values() { + return values(DomainTopicProvisioningState.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopics.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopics.java new file mode 100644 index 0000000000000..b5924c25a604f --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainTopics.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.DomainTopicsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DomainTopics. + */ +public interface DomainTopics extends SupportsCreating, HasInner { + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String domainName, String domainTopicName); + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDomainAsync(final String resourceGroupName, final String domainName); + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String domainName, String domainTopicName); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainUpdateParameters.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainUpdateParameters.java new file mode 100644 index 0000000000000..4ea8ba8dec348 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/DomainUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Domain update. + */ +public class DomainUpdateParameters { + /** + * Tags of the domains resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get tags of the domains resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags of the domains resource. + * + * @param tags the tags value to set + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domains.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domains.java new file mode 100644 index 0000000000000..6f88b14a1de3e --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Domains.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.DomainsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Domains. + */ +public interface Domains extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSharedAccessKeysAsync(String resourceGroupName, String domainName); + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String domainName, String keyName); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventDeliverySchema.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventDeliverySchema.java new file mode 100644 index 0000000000000..c58808ce1baa9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventDeliverySchema.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventDeliverySchema. + */ +public final class EventDeliverySchema extends ExpandableStringEnum { + /** Static value EventGridSchema for EventDeliverySchema. */ + public static final EventDeliverySchema EVENT_GRID_SCHEMA = fromString("EventGridSchema"); + + /** Static value CloudEventV01Schema for EventDeliverySchema. */ + public static final EventDeliverySchema CLOUD_EVENT_V01SCHEMA = fromString("CloudEventV01Schema"); + + /** Static value CustomInputSchema for EventDeliverySchema. */ + public static final EventDeliverySchema CUSTOM_INPUT_SCHEMA = fromString("CustomInputSchema"); + + /** + * Creates or finds a EventDeliverySchema from its string representation. + * @param name a name to look for + * @return the corresponding EventDeliverySchema + */ + @JsonCreator + public static EventDeliverySchema fromString(String name) { + return fromString(name, EventDeliverySchema.class); + } + + /** + * @return known EventDeliverySchema values + */ + public static Collection values() { + return values(EventDeliverySchema.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventHubEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventHubEventSubscriptionDestination.java new file mode 100644 index 0000000000000..4d6c8686a3e9c --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventHubEventSubscriptionDestination.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the event hub destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("EventHub") +@JsonFlatten +public class EventHubEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource Id that represents the endpoint of an Event Hub + * destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the EventHubEventSubscriptionDestination object itself. + */ + public EventHubEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscription.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscription.java new file mode 100644 index 0000000000000..f2e4f9989675a --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscription.java @@ -0,0 +1,302 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventSubscriptionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing EventSubscription. + */ +public interface EventSubscription extends HasInner, Indexable, Updatable, Refreshable, HasManager { + /** + * @return the deadLetterDestination value. + */ + DeadLetterDestination deadLetterDestination(); + + /** + * @return the destination value. + */ + EventSubscriptionDestination destination(); + + /** + * @return the eventDeliverySchema value. + */ + EventDeliverySchema eventDeliverySchema(); + + /** + * @return the expirationTimeUtc value. + */ + DateTime expirationTimeUtc(); + + /** + * @return the filter value. + */ + EventSubscriptionFilter filter(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the labels value. + */ + List labels(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + EventSubscriptionProvisioningState provisioningState(); + + /** + * @return the retryPolicy value. + */ + RetryPolicy retryPolicy(); + + /** + * @return the topic value. + */ + String topic(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the EventSubscription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** + * Grouping of EventSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EventSubscription definition. + */ + interface Blank extends WithScope { + } + + /** + * The stage of the eventsubscription definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic + * @return the next definition stage + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the eventsubscription definition allowing to specify DeadLetterDestination. + */ + interface WithDeadLetterDestination { + /** + * Specifies deadLetterDestination. + * @param deadLetterDestination The DeadLetter destination of the event subscription + * @return the next definition stage + */ + WithCreate withDeadLetterDestination(DeadLetterDestination deadLetterDestination); + } + + /** + * The stage of the eventsubscription definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Information about the destination where events have to be delivered for the event subscription + * @return the next definition stage + */ + WithCreate withDestination(EventSubscriptionDestination destination); + } + + /** + * The stage of the eventsubscription definition allowing to specify EventDeliverySchema. + */ + interface WithEventDeliverySchema { + /** + * Specifies eventDeliverySchema. + * @param eventDeliverySchema The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema' + * @return the next definition stage + */ + WithCreate withEventDeliverySchema(EventDeliverySchema eventDeliverySchema); + } + + /** + * The stage of the eventsubscription definition allowing to specify ExpirationTimeUtc. + */ + interface WithExpirationTimeUtc { + /** + * Specifies expirationTimeUtc. + * @param expirationTimeUtc Expiration time of the event subscription + * @return the next definition stage + */ + WithCreate withExpirationTimeUtc(DateTime expirationTimeUtc); + } + + /** + * The stage of the eventsubscription definition allowing to specify Filter. + */ + interface WithFilter { + /** + * Specifies filter. + * @param filter Information about the filter for the event subscription + * @return the next definition stage + */ + WithCreate withFilter(EventSubscriptionFilter filter); + } + + /** + * The stage of the eventsubscription definition allowing to specify Labels. + */ + interface WithLabels { + /** + * Specifies labels. + * @param labels List of user defined labels + * @return the next definition stage + */ + WithCreate withLabels(List labels); + } + + /** + * The stage of the eventsubscription definition allowing to specify RetryPolicy. + */ + interface WithRetryPolicy { + /** + * Specifies retryPolicy. + * @param retryPolicy The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events + * @return the next definition stage + */ + WithCreate withRetryPolicy(RetryPolicy retryPolicy); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDeadLetterDestination, DefinitionStages.WithDestination, DefinitionStages.WithEventDeliverySchema, DefinitionStages.WithExpirationTimeUtc, DefinitionStages.WithFilter, DefinitionStages.WithLabels, DefinitionStages.WithRetryPolicy { + } + } + /** + * The template for a EventSubscription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDeadLetterDestination, UpdateStages.WithDestination, UpdateStages.WithEventDeliverySchema, UpdateStages.WithExpirationTimeUtc, UpdateStages.WithFilter, UpdateStages.WithLabels, UpdateStages.WithRetryPolicy { + } + + /** + * Grouping of EventSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the eventsubscription update allowing to specify DeadLetterDestination. + */ + interface WithDeadLetterDestination { + /** + * Specifies deadLetterDestination. + * @param deadLetterDestination The DeadLetter destination of the event subscription + * @return the next update stage + */ + Update withDeadLetterDestination(DeadLetterDestination deadLetterDestination); + } + + /** + * The stage of the eventsubscription update allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Information about the destination where events have to be delivered for the event subscription + * @return the next update stage + */ + Update withDestination(EventSubscriptionDestination destination); + } + + /** + * The stage of the eventsubscription update allowing to specify EventDeliverySchema. + */ + interface WithEventDeliverySchema { + /** + * Specifies eventDeliverySchema. + * @param eventDeliverySchema The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema' + * @return the next update stage + */ + Update withEventDeliverySchema(EventDeliverySchema eventDeliverySchema); + } + + /** + * The stage of the eventsubscription update allowing to specify ExpirationTimeUtc. + */ + interface WithExpirationTimeUtc { + /** + * Specifies expirationTimeUtc. + * @param expirationTimeUtc Information about the expiration time for the event subscription + * @return the next update stage + */ + Update withExpirationTimeUtc(DateTime expirationTimeUtc); + } + + /** + * The stage of the eventsubscription update allowing to specify Filter. + */ + interface WithFilter { + /** + * Specifies filter. + * @param filter Information about the filter for the event subscription + * @return the next update stage + */ + Update withFilter(EventSubscriptionFilter filter); + } + + /** + * The stage of the eventsubscription update allowing to specify Labels. + */ + interface WithLabels { + /** + * Specifies labels. + * @param labels List of user defined labels + * @return the next update stage + */ + Update withLabels(List labels); + } + + /** + * The stage of the eventsubscription update allowing to specify RetryPolicy. + */ + interface WithRetryPolicy { + /** + * Specifies retryPolicy. + * @param retryPolicy The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events + * @return the next update stage + */ + Update withRetryPolicy(RetryPolicy retryPolicy); + } + + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionDestination.java new file mode 100644 index 0000000000000..f5d98d9522af4 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionDestination.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("EventSubscriptionDestination") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "WebHook", value = WebHookEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "EventHub", value = EventHubEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "StorageQueue", value = StorageQueueEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "HybridConnection", value = HybridConnectionEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "ServiceBusQueue", value = ServiceBusQueueEventSubscriptionDestination.class) +}) +public class EventSubscriptionDestination { +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFilter.java new file mode 100644 index 0000000000000..e4222254e9f11 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFilter.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter for the Event Subscription. + */ +public class EventSubscriptionFilter { + /** + * An optional string to filter events for an event subscription based on a + * resource path prefix. + * The format of this depends on the publisher of the events. + * Wildcard characters are not supported in this path. + */ + @JsonProperty(value = "subjectBeginsWith") + private String subjectBeginsWith; + + /** + * An optional string to filter events for an event subscription based on a + * resource path suffix. + * Wildcard characters are not supported in this path. + */ + @JsonProperty(value = "subjectEndsWith") + private String subjectEndsWith; + + /** + * A list of applicable event types that need to be part of the event + * subscription. If it is desired to subscribe to all default event types, + * set the IncludedEventTypes to null. + */ + @JsonProperty(value = "includedEventTypes") + private List includedEventTypes; + + /** + * Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the + * filter + * should be compared in a case sensitive manner. + */ + @JsonProperty(value = "isSubjectCaseSensitive") + private Boolean isSubjectCaseSensitive; + + /** + * An array of advanced filters that are used for filtering event + * subscriptions. + */ + @JsonProperty(value = "advancedFilters") + private List advancedFilters; + + /** + * Get an optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + * + * @return the subjectBeginsWith value + */ + public String subjectBeginsWith() { + return this.subjectBeginsWith; + } + + /** + * Set an optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + * + * @param subjectBeginsWith the subjectBeginsWith value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withSubjectBeginsWith(String subjectBeginsWith) { + this.subjectBeginsWith = subjectBeginsWith; + return this; + } + + /** + * Get an optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + * + * @return the subjectEndsWith value + */ + public String subjectEndsWith() { + return this.subjectEndsWith; + } + + /** + * Set an optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + * + * @param subjectEndsWith the subjectEndsWith value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withSubjectEndsWith(String subjectEndsWith) { + this.subjectEndsWith = subjectEndsWith; + return this; + } + + /** + * Get a list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. + * + * @return the includedEventTypes value + */ + public List includedEventTypes() { + return this.includedEventTypes; + } + + /** + * Set a list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. + * + * @param includedEventTypes the includedEventTypes value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withIncludedEventTypes(List includedEventTypes) { + this.includedEventTypes = includedEventTypes; + return this; + } + + /** + * Get specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. + * + * @return the isSubjectCaseSensitive value + */ + public Boolean isSubjectCaseSensitive() { + return this.isSubjectCaseSensitive; + } + + /** + * Set specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. + * + * @param isSubjectCaseSensitive the isSubjectCaseSensitive value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withIsSubjectCaseSensitive(Boolean isSubjectCaseSensitive) { + this.isSubjectCaseSensitive = isSubjectCaseSensitive; + return this; + } + + /** + * Get an array of advanced filters that are used for filtering event subscriptions. + * + * @return the advancedFilters value + */ + public List advancedFilters() { + return this.advancedFilters; + } + + /** + * Set an array of advanced filters that are used for filtering event subscriptions. + * + * @param advancedFilters the advancedFilters value to set + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withAdvancedFilters(List advancedFilters) { + this.advancedFilters = advancedFilters; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFullUrl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFullUrl.java new file mode 100644 index 0000000000000..3104aa6994fa5 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionFullUrl.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventSubscriptionFullUrlInner; + +/** + * Type representing EventSubscriptionFullUrl. + */ +public interface EventSubscriptionFullUrl extends HasInner, HasManager { + /** + * @return the endpointUrl value. + */ + String endpointUrl(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionProvisioningState.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionProvisioningState.java new file mode 100644 index 0000000000000..9546044a07eef --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionProvisioningState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventSubscriptionProvisioningState. + */ +public final class EventSubscriptionProvisioningState extends ExpandableStringEnum { + /** Static value Creating for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState FAILED = fromString("Failed"); + + /** Static value AwaitingManualAction for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState AWAITING_MANUAL_ACTION = fromString("AwaitingManualAction"); + + /** + * Creates or finds a EventSubscriptionProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding EventSubscriptionProvisioningState + */ + @JsonCreator + public static EventSubscriptionProvisioningState fromString(String name) { + return fromString(name, EventSubscriptionProvisioningState.class); + } + + /** + * @return known EventSubscriptionProvisioningState values + */ + public static Collection values() { + return values(EventSubscriptionProvisioningState.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionUpdateParameters.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionUpdateParameters.java new file mode 100644 index 0000000000000..c0d2d156765ac --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptionUpdateParameters.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Event Subscription update. + */ +public class EventSubscriptionUpdateParameters { + /** + * Information about the destination where events have to be delivered for + * the event subscription. + */ + @JsonProperty(value = "destination") + private EventSubscriptionDestination destination; + + /** + * Information about the filter for the event subscription. + */ + @JsonProperty(value = "filter") + private EventSubscriptionFilter filter; + + /** + * List of user defined labels. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * Information about the expiration time for the event subscription. + */ + @JsonProperty(value = "expirationTimeUtc") + private DateTime expirationTimeUtc; + + /** + * The event delivery schema for the event subscription. Possible values + * include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema'. + */ + @JsonProperty(value = "eventDeliverySchema") + private EventDeliverySchema eventDeliverySchema; + + /** + * The retry policy for events. This can be used to configure maximum + * number of delivery attempts and time to live for events. + */ + @JsonProperty(value = "retryPolicy") + private RetryPolicy retryPolicy; + + /** + * The DeadLetter destination of the event subscription. + */ + @JsonProperty(value = "deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + + /** + * Get information about the destination where events have to be delivered for the event subscription. + * + * @return the destination value + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set information about the destination where events have to be delivered for the event subscription. + * + * @param destination the destination value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get information about the filter for the event subscription. + * + * @return the filter value + */ + public EventSubscriptionFilter filter() { + return this.filter; + } + + /** + * Set information about the filter for the event subscription. + * + * @param filter the filter value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withFilter(EventSubscriptionFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get list of user defined labels. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set list of user defined labels. + * + * @param labels the labels value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get information about the expiration time for the event subscription. + * + * @return the expirationTimeUtc value + */ + public DateTime expirationTimeUtc() { + return this.expirationTimeUtc; + } + + /** + * Set information about the expiration time for the event subscription. + * + * @param expirationTimeUtc the expirationTimeUtc value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withExpirationTimeUtc(DateTime expirationTimeUtc) { + this.expirationTimeUtc = expirationTimeUtc; + return this; + } + + /** + * Get the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema'. + * + * @return the eventDeliverySchema value + */ + public EventDeliverySchema eventDeliverySchema() { + return this.eventDeliverySchema; + } + + /** + * Set the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema'. + * + * @param eventDeliverySchema the eventDeliverySchema value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + this.eventDeliverySchema = eventDeliverySchema; + return this; + } + + /** + * Get the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @param retryPolicy the retryPolicy value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get the DeadLetter destination of the event subscription. + * + * @return the deadLetterDestination value + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the DeadLetter destination of the event subscription. + * + * @param deadLetterDestination the deadLetterDestination value to set + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptions.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptions.java new file mode 100644 index 0000000000000..681bd5b642824 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventSubscriptions.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventSubscriptionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EventSubscriptions. + */ +public interface EventSubscriptions extends SupportsCreating, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String scope, String eventSubscriptionName); + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String scope, String eventSubscriptionName); + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFullUrlAsync(String scope, String eventSubscriptionName); + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName); + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName); + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalBySubscriptionAsync(final String location); + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalByResourceGroupAsync(final String resourceGroupName, final String location); + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName); + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName); + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName); + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventType.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventType.java new file mode 100644 index 0000000000000..26c6ae4a93865 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/EventType.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventTypeInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; + +/** + * Type representing EventType. + */ +public interface EventType extends HasInner, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isInDefaultSet value. + */ + Boolean isInDefaultSet(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the schemaUrl value. + */ + String schemaUrl(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/HybridConnectionEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/HybridConnectionEventSubscriptionDestination.java new file mode 100644 index 0000000000000..cafc39144020a --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/HybridConnectionEventSubscriptionDestination.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the HybridConnection destination for an event + * subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("HybridConnection") +@JsonFlatten +public class HybridConnectionEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource ID of an hybrid connection that is the destination of + * an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource ID of an hybrid connection that is the destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of an hybrid connection that is the destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the HybridConnectionEventSubscriptionDestination object itself. + */ + public HybridConnectionEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchema.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchema.java new file mode 100644 index 0000000000000..3c9c10cd1a5f6 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchema.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InputSchema. + */ +public final class InputSchema extends ExpandableStringEnum { + /** Static value EventGridSchema for InputSchema. */ + public static final InputSchema EVENT_GRID_SCHEMA = fromString("EventGridSchema"); + + /** Static value CustomEventSchema for InputSchema. */ + public static final InputSchema CUSTOM_EVENT_SCHEMA = fromString("CustomEventSchema"); + + /** Static value CloudEventV01Schema for InputSchema. */ + public static final InputSchema CLOUD_EVENT_V01SCHEMA = fromString("CloudEventV01Schema"); + + /** + * Creates or finds a InputSchema from its string representation. + * @param name a name to look for + * @return the corresponding InputSchema + */ + @JsonCreator + public static InputSchema fromString(String name) { + return fromString(name, InputSchema.class); + } + + /** + * @return known InputSchema values + */ + public static Collection values() { + return values(InputSchema.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchemaMapping.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchemaMapping.java new file mode 100644 index 0000000000000..fdb5239cf90e9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/InputSchemaMapping.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * By default, Event Grid expects events to be in the Event Grid event schema. + * Specifying an input schema mapping enables publishing to Event Grid using a + * custom input schema. Currently, the only supported type of + * InputSchemaMapping is 'JsonInputSchemaMapping'. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputSchemaMappingType") +@JsonTypeName("InputSchemaMapping") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Json", value = JsonInputSchemaMapping.class) +}) +public class InputSchemaMapping { +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonField.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonField.java new file mode 100644 index 0000000000000..cf09d9897a1bf --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonField.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to express the source of an input schema mapping for a single + * target field in the Event Grid Event schema. This is currently used in the + * mappings for the 'id', 'topic' and 'eventtime' properties. This represents a + * field in the input event schema. + */ +public class JsonField { + /** + * Name of a field in the input event schema that's to be used as the + * source of a mapping. + */ + @JsonProperty(value = "sourceField") + private String sourceField; + + /** + * Get name of a field in the input event schema that's to be used as the source of a mapping. + * + * @return the sourceField value + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set name of a field in the input event schema that's to be used as the source of a mapping. + * + * @param sourceField the sourceField value to set + * @return the JsonField object itself. + */ + public JsonField withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonFieldWithDefault.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonFieldWithDefault.java new file mode 100644 index 0000000000000..6f13a410ea0cd --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonFieldWithDefault.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to express the source of an input schema mapping for a single + * target field + * in the Event Grid Event schema. This is currently used in the mappings for + * the 'subject', + * 'eventtype' and 'dataversion' properties. This represents a field in the + * input event schema + * along with a default value to be used, and at least one of these two + * properties should be provided. + */ +public class JsonFieldWithDefault { + /** + * Name of a field in the input event schema that's to be used as the + * source of a mapping. + */ + @JsonProperty(value = "sourceField") + private String sourceField; + + /** + * The default value to be used for mapping when a SourceField is not + * provided or if there's no property with the specified name in the + * published JSON event payload. + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /** + * Get name of a field in the input event schema that's to be used as the source of a mapping. + * + * @return the sourceField value + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set name of a field in the input event schema that's to be used as the source of a mapping. + * + * @param sourceField the sourceField value to set + * @return the JsonFieldWithDefault object itself. + */ + public JsonFieldWithDefault withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + + /** + * Get the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload. + * + * @return the defaultValue value + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload. + * + * @param defaultValue the defaultValue value to set + * @return the JsonFieldWithDefault object itself. + */ + public JsonFieldWithDefault withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonInputSchemaMapping.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonInputSchemaMapping.java new file mode 100644 index 0000000000000..a23991b76b789 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/JsonInputSchemaMapping.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * This enables publishing to Event Grid using a custom input schema. This can + * be used to map properties from a custom input JSON schema to the Event Grid + * event schema. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputSchemaMappingType") +@JsonTypeName("Json") +@JsonFlatten +public class JsonInputSchemaMapping extends InputSchemaMapping { + /** + * The mapping information for the Id property of the Event Grid Event. + */ + @JsonProperty(value = "properties.id") + private JsonField id; + + /** + * The mapping information for the Topic property of the Event Grid Event. + */ + @JsonProperty(value = "properties.topic") + private JsonField topic; + + /** + * The mapping information for the EventTime property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.eventTime") + private JsonField eventTime; + + /** + * The mapping information for the EventType property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.eventType") + private JsonFieldWithDefault eventType; + + /** + * The mapping information for the Subject property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.subject") + private JsonFieldWithDefault subject; + + /** + * The mapping information for the DataVersion property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.dataVersion") + private JsonFieldWithDefault dataVersion; + + /** + * Get the mapping information for the Id property of the Event Grid Event. + * + * @return the id value + */ + public JsonField id() { + return this.id; + } + + /** + * Set the mapping information for the Id property of the Event Grid Event. + * + * @param id the id value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withId(JsonField id) { + this.id = id; + return this; + } + + /** + * Get the mapping information for the Topic property of the Event Grid Event. + * + * @return the topic value + */ + public JsonField topic() { + return this.topic; + } + + /** + * Set the mapping information for the Topic property of the Event Grid Event. + * + * @param topic the topic value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withTopic(JsonField topic) { + this.topic = topic; + return this; + } + + /** + * Get the mapping information for the EventTime property of the Event Grid Event. + * + * @return the eventTime value + */ + public JsonField eventTime() { + return this.eventTime; + } + + /** + * Set the mapping information for the EventTime property of the Event Grid Event. + * + * @param eventTime the eventTime value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withEventTime(JsonField eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get the mapping information for the EventType property of the Event Grid Event. + * + * @return the eventType value + */ + public JsonFieldWithDefault eventType() { + return this.eventType; + } + + /** + * Set the mapping information for the EventType property of the Event Grid Event. + * + * @param eventType the eventType value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withEventType(JsonFieldWithDefault eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the mapping information for the Subject property of the Event Grid Event. + * + * @return the subject value + */ + public JsonFieldWithDefault subject() { + return this.subject; + } + + /** + * Set the mapping information for the Subject property of the Event Grid Event. + * + * @param subject the subject value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withSubject(JsonFieldWithDefault subject) { + this.subject = subject; + return this; + } + + /** + * Get the mapping information for the DataVersion property of the Event Grid Event. + * + * @return the dataVersion value + */ + public JsonFieldWithDefault dataVersion() { + return this.dataVersion; + } + + /** + * Set the mapping information for the DataVersion property of the Event Grid Event. + * + * @param dataVersion the dataVersion value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withDataVersion(JsonFieldWithDefault dataVersion) { + this.dataVersion = dataVersion; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanAdvancedFilter.java new file mode 100644 index 0000000000000..0ae34f9d74b3c --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberGreaterThan Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberGreaterThan") +public class NumberGreaterThanAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberGreaterThanAdvancedFilter object itself. + */ + public NumberGreaterThanAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanOrEqualsAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanOrEqualsAdvancedFilter.java new file mode 100644 index 0000000000000..9d37ddc2a897f --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberGreaterThanOrEqualsAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberGreaterThanOrEquals Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberGreaterThanOrEquals") +public class NumberGreaterThanOrEqualsAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberGreaterThanOrEqualsAdvancedFilter object itself. + */ + public NumberGreaterThanOrEqualsAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberInAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberInAdvancedFilter.java new file mode 100644 index 0000000000000..2bd9a8e39c093 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberIn") +public class NumberInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the NumberInAdvancedFilter object itself. + */ + public NumberInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanAdvancedFilter.java new file mode 100644 index 0000000000000..535f42aeeb592 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberLessThan Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberLessThan") +public class NumberLessThanAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberLessThanAdvancedFilter object itself. + */ + public NumberLessThanAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanOrEqualsAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanOrEqualsAdvancedFilter.java new file mode 100644 index 0000000000000..da4484b846420 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberLessThanOrEqualsAdvancedFilter.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberLessThanOrEquals Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberLessThanOrEquals") +public class NumberLessThanOrEqualsAdvancedFilter extends AdvancedFilter { + /** + * The filter value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the filter value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the filter value. + * + * @param value the value value to set + * @return the NumberLessThanOrEqualsAdvancedFilter object itself. + */ + public NumberLessThanOrEqualsAdvancedFilter withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberNotInAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberNotInAdvancedFilter.java new file mode 100644 index 0000000000000..28fe15c3e9625 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/NumberNotInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberNotIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberNotIn") +public class NumberNotInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the NumberNotInAdvancedFilter object itself. + */ + public NumberNotInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operation.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operation.java new file mode 100644 index 0000000000000..7d7f9197ece2c --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationInfo display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/OperationInfo.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/OperationInfo.java new file mode 100644 index 0000000000000..4025302e1a810 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/OperationInfo.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an operation. + */ +public class OperationInfo { + /** + * Name of the provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Name of the resource type. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the provider. + * + * @param provider the provider value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get name of the resource type. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set name of the resource type. + * + * @param resource the resource value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set name of the operation. + * + * @param operation the operation value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationInfo object itself. + */ + public OperationInfo withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operations.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operations.java new file mode 100644 index 0000000000000..7adf48c8143d4 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ResourceRegionType.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ResourceRegionType.java new file mode 100644 index 0000000000000..87c550a131258 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ResourceRegionType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceRegionType. + */ +public final class ResourceRegionType extends ExpandableStringEnum { + /** Static value RegionalResource for ResourceRegionType. */ + public static final ResourceRegionType REGIONAL_RESOURCE = fromString("RegionalResource"); + + /** Static value GlobalResource for ResourceRegionType. */ + public static final ResourceRegionType GLOBAL_RESOURCE = fromString("GlobalResource"); + + /** + * Creates or finds a ResourceRegionType from its string representation. + * @param name a name to look for + * @return the corresponding ResourceRegionType + */ + @JsonCreator + public static ResourceRegionType fromString(String name) { + return fromString(name, ResourceRegionType.class); + } + + /** + * @return known ResourceRegionType values + */ + public static Collection values() { + return values(ResourceRegionType.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/RetryPolicy.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/RetryPolicy.java new file mode 100644 index 0000000000000..b3b382bb2697e --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/RetryPolicy.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the retry policy for an event subscription. + */ +public class RetryPolicy { + /** + * Maximum number of delivery retry attempts for events. + */ + @JsonProperty(value = "maxDeliveryAttempts") + private Integer maxDeliveryAttempts; + + /** + * Time To Live (in minutes) for events. + */ + @JsonProperty(value = "eventTimeToLiveInMinutes") + private Integer eventTimeToLiveInMinutes; + + /** + * Get maximum number of delivery retry attempts for events. + * + * @return the maxDeliveryAttempts value + */ + public Integer maxDeliveryAttempts() { + return this.maxDeliveryAttempts; + } + + /** + * Set maximum number of delivery retry attempts for events. + * + * @param maxDeliveryAttempts the maxDeliveryAttempts value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withMaxDeliveryAttempts(Integer maxDeliveryAttempts) { + this.maxDeliveryAttempts = maxDeliveryAttempts; + return this; + } + + /** + * Get time To Live (in minutes) for events. + * + * @return the eventTimeToLiveInMinutes value + */ + public Integer eventTimeToLiveInMinutes() { + return this.eventTimeToLiveInMinutes; + } + + /** + * Set time To Live (in minutes) for events. + * + * @param eventTimeToLiveInMinutes the eventTimeToLiveInMinutes value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withEventTimeToLiveInMinutes(Integer eventTimeToLiveInMinutes) { + this.eventTimeToLiveInMinutes = eventTimeToLiveInMinutes; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ServiceBusQueueEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ServiceBusQueueEventSubscriptionDestination.java new file mode 100644 index 0000000000000..5ee1356ff6520 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/ServiceBusQueueEventSubscriptionDestination.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the service bus destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("ServiceBusQueue") +@JsonFlatten +public class ServiceBusQueueEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource Id that represents the endpoint of the Service Bus + * destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the ServiceBusQueueEventSubscriptionDestination object itself. + */ + public ServiceBusQueueEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageBlobDeadLetterDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageBlobDeadLetterDestination.java new file mode 100644 index 0000000000000..36e2bf4b62e76 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageBlobDeadLetterDestination.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the storage blob based dead letter destination. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("StorageBlob") +@JsonFlatten +public class StorageBlobDeadLetterDestination extends DeadLetterDestination { + /** + * The Azure Resource ID of the storage account that is the destination of + * the deadletter events. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The name of the Storage blob container that is the destination of the + * deadletter events. + */ + @JsonProperty(value = "properties.blobContainerName") + private String blobContainerName; + + /** + * Get the Azure Resource ID of the storage account that is the destination of the deadletter events. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of the storage account that is the destination of the deadletter events. + * + * @param resourceId the resourceId value to set + * @return the StorageBlobDeadLetterDestination object itself. + */ + public StorageBlobDeadLetterDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the name of the Storage blob container that is the destination of the deadletter events. + * + * @return the blobContainerName value + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Set the name of the Storage blob container that is the destination of the deadletter events. + * + * @param blobContainerName the blobContainerName value to set + * @return the StorageBlobDeadLetterDestination object itself. + */ + public StorageBlobDeadLetterDestination withBlobContainerName(String blobContainerName) { + this.blobContainerName = blobContainerName; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageQueueEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageQueueEventSubscriptionDestination.java new file mode 100644 index 0000000000000..be4e22d598fd0 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StorageQueueEventSubscriptionDestination.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the storage queue destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("StorageQueue") +@JsonFlatten +public class StorageQueueEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource ID of the storage account that contains the queue + * that is the destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The name of the Storage queue under a storage account that is the + * destination of an event subscription. + */ + @JsonProperty(value = "properties.queueName") + private String queueName; + + /** + * Get the Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + * + * @param resourceId the resourceId value to set + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the name of the Storage queue under a storage account that is the destination of an event subscription. + * + * @return the queueName value + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the name of the Storage queue under a storage account that is the destination of an event subscription. + * + * @param queueName the queueName value to set + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringBeginsWithAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringBeginsWithAdvancedFilter.java new file mode 100644 index 0000000000000..fb7676b6398ab --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringBeginsWithAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringBeginsWith Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringBeginsWith") +public class StringBeginsWithAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringBeginsWithAdvancedFilter object itself. + */ + public StringBeginsWithAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringContainsAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringContainsAdvancedFilter.java new file mode 100644 index 0000000000000..bbea302597a33 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringContainsAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringContains Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringContains") +public class StringContainsAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringContainsAdvancedFilter object itself. + */ + public StringContainsAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringEndsWithAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringEndsWithAdvancedFilter.java new file mode 100644 index 0000000000000..3e8e1d14defd7 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringEndsWithAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringEndsWith Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringEndsWith") +public class StringEndsWithAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringEndsWithAdvancedFilter object itself. + */ + public StringEndsWithAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringInAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringInAdvancedFilter.java new file mode 100644 index 0000000000000..b2bfb04f86e39 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringIn") +public class StringInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringInAdvancedFilter object itself. + */ + public StringInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringNotInAdvancedFilter.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringNotInAdvancedFilter.java new file mode 100644 index 0000000000000..ba52e4ca7c89d --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/StringNotInAdvancedFilter.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * StringNotIn Advanced Filter. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringNotIn") +public class StringNotInAdvancedFilter extends AdvancedFilter { + /** + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the set of filter values. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the set of filter values. + * + * @param values the values value to set + * @return the StringNotInAdvancedFilter object itself. + */ + public StringNotInAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topic.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topic.java new file mode 100644 index 0000000000000..c9ac007b17414 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topic.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.TopicInner; + +/** + * Type representing Topic. + */ +public interface Topic extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the inputSchema value. + */ + InputSchema inputSchema(); + + /** + * @return the inputSchemaMapping value. + */ + InputSchemaMapping inputSchemaMapping(); + + /** + * @return the provisioningState value. + */ + TopicProvisioningState provisioningState(); + + /** + * The entirety of the Topic definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Topic definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Topic definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Topic definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the topic definition allowing to specify InputSchema. + */ + interface WithInputSchema { + /** + * Specifies inputSchema. + * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + * @return the next definition stage + */ + WithCreate withInputSchema(InputSchema inputSchema); + } + + /** + * The stage of the topic definition allowing to specify InputSchemaMapping. + */ + interface WithInputSchemaMapping { + /** + * Specifies inputSchemaMapping. + * @param inputSchemaMapping This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema + * @return the next definition stage + */ + WithCreate withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping { + } + } + /** + * The template for a Topic update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithInputSchema, UpdateStages.WithInputSchemaMapping { + } + + /** + * Grouping of Topic update stages. + */ + interface UpdateStages { + /** + * The stage of the topic update allowing to specify InputSchema. + */ + interface WithInputSchema { + /** + * Specifies inputSchema. + * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + * @return the next update stage + */ + Update withInputSchema(InputSchema inputSchema); + } + + /** + * The stage of the topic update allowing to specify InputSchemaMapping. + */ + interface WithInputSchemaMapping { + /** + * Specifies inputSchemaMapping. + * @param inputSchemaMapping This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema + * @return the next update stage + */ + Update withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); + } + + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicProvisioningState.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicProvisioningState.java new file mode 100644 index 0000000000000..c9c6626107527 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TopicProvisioningState. + */ +public final class TopicProvisioningState extends ExpandableStringEnum { + /** Static value Creating for TopicProvisioningState. */ + public static final TopicProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for TopicProvisioningState. */ + public static final TopicProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for TopicProvisioningState. */ + public static final TopicProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for TopicProvisioningState. */ + public static final TopicProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for TopicProvisioningState. */ + public static final TopicProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for TopicProvisioningState. */ + public static final TopicProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a TopicProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding TopicProvisioningState + */ + @JsonCreator + public static TopicProvisioningState fromString(String name) { + return fromString(name, TopicProvisioningState.class); + } + + /** + * @return known TopicProvisioningState values + */ + public static Collection values() { + return values(TopicProvisioningState.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicRegenerateKeyRequest.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicRegenerateKeyRequest.java new file mode 100644 index 0000000000000..eaa1af0be5071 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicRegenerateKeyRequest.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topic regenerate share access key request. + */ +public class TopicRegenerateKeyRequest { + /** + * Key name to regenerate key1 or key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get key name to regenerate key1 or key2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set key name to regenerate key1 or key2. + * + * @param keyName the keyName value to set + * @return the TopicRegenerateKeyRequest object itself. + */ + public TopicRegenerateKeyRequest withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicSharedAccessKeys.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicSharedAccessKeys.java new file mode 100644 index 0000000000000..90c594bb64566 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicSharedAccessKeys.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.TopicSharedAccessKeysInner; + +/** + * Type representing TopicSharedAccessKeys. + */ +public interface TopicSharedAccessKeys extends HasInner, HasManager { + /** + * @return the key1 value. + */ + String key1(); + + /** + * @return the key2 value. + */ + String key2(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeInfo.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeInfo.java new file mode 100644 index 0000000000000..333a7a06b63a9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeInfo.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.EventGridManager; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.TopicTypeInfoInner; +import java.util.List; + +/** + * Type representing TopicTypeInfo. + */ +public interface TopicTypeInfo extends HasInner, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provider value. + */ + String provider(); + + /** + * @return the provisioningState value. + */ + TopicTypeProvisioningState provisioningState(); + + /** + * @return the resourceRegionType value. + */ + ResourceRegionType resourceRegionType(); + + /** + * @return the supportedLocations value. + */ + List supportedLocations(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeProvisioningState.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeProvisioningState.java new file mode 100644 index 0000000000000..2bef1120726cc --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypeProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TopicTypeProvisioningState. + */ +public final class TopicTypeProvisioningState extends ExpandableStringEnum { + /** Static value Creating for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for TopicTypeProvisioningState. */ + public static final TopicTypeProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a TopicTypeProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding TopicTypeProvisioningState + */ + @JsonCreator + public static TopicTypeProvisioningState fromString(String name) { + return fromString(name, TopicTypeProvisioningState.class); + } + + /** + * @return known TopicTypeProvisioningState values + */ + public static Collection values() { + return values(TopicTypeProvisioningState.class); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypes.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypes.java new file mode 100644 index 0000000000000..3ea43579f75ff --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicTypes.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.TopicTypesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TopicTypes. + */ +public interface TopicTypes extends HasInner { + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventTypesAsync(String topicTypeName); + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String topicTypeName); + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicUpdateParameters.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicUpdateParameters.java new file mode 100644 index 0000000000000..cabe6e332ed0f --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/TopicUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Topic update. + */ +public class TopicUpdateParameters { + /** + * Tags of the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get tags of the resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags of the resource. + * + * @param tags the tags value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topics.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topics.java new file mode 100644 index 0000000000000..d2cea9a4b7eab --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/Topics.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation.TopicsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Topics. + */ +public interface Topics extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSharedAccessKeysAsync(String resourceGroupName, String topicName); + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String topicName, String keyName); + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the topic type + * @param resourceName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName); + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/WebHookEventSubscriptionDestination.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/WebHookEventSubscriptionDestination.java new file mode 100644 index 0000000000000..8d59d1c306cb9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/WebHookEventSubscriptionDestination.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the webhook destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("WebHook") +@JsonFlatten +public class WebHookEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The URL that represents the endpoint of the destination of an event + * subscription. + */ + @JsonProperty(value = "properties.endpointUrl") + private String endpointUrl; + + /** + * The base URL that represents the endpoint of the destination of an event + * subscription. + */ + @JsonProperty(value = "properties.endpointBaseUrl", access = JsonProperty.Access.WRITE_ONLY) + private String endpointBaseUrl; + + /** + * Get the URL that represents the endpoint of the destination of an event subscription. + * + * @return the endpointUrl value + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the URL that represents the endpoint of the destination of an event subscription. + * + * @param endpointUrl the endpointUrl value to set + * @return the WebHookEventSubscriptionDestination object itself. + */ + public WebHookEventSubscriptionDestination withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Get the base URL that represents the endpoint of the destination of an event subscription. + * + * @return the endpointBaseUrl value + */ + public String endpointBaseUrl() { + return this.endpointBaseUrl; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainImpl.java new file mode 100644 index 0000000000000..bf0af7288f8ee --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domain; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchema; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchemaMapping; + +class DomainImpl extends GroupableResourceCoreImpl implements Domain, Domain.Definition, Domain.Update { + DomainImpl(String name, DomainInner inner, EventGridManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DomainsInner client = this.manager().inner().domains(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DomainsInner client = this.manager().inner().domains(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DomainsInner client = this.manager().inner().domains(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public InputSchema inputSchema() { + return this.inner().inputSchema(); + } + + @Override + public InputSchemaMapping inputSchemaMapping() { + return this.inner().inputSchemaMapping(); + } + + @Override + public DomainProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DomainImpl withInputSchema(InputSchema inputSchema) { + this.inner().withInputSchema(inputSchema); + return this; + } + + @Override + public DomainImpl withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inner().withInputSchemaMapping(inputSchemaMapping); + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainInner.java new file mode 100644 index 0000000000000..ecbfb9bc650d3 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainInner.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchema; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchemaMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * EventGrid Domain. + */ +@JsonFlatten +public class DomainInner extends Resource { + /** + * Provisioning state of the domain. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DomainProvisioningState provisioningState; + + /** + * Endpoint for the domain. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * This determines the format that Event Grid should expect for incoming + * events published to the domain. Possible values include: + * 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + */ + @JsonProperty(value = "properties.inputSchema") + private InputSchema inputSchema; + + /** + * Information about the InputSchemaMapping which specified the info about + * mapping event payload. + */ + @JsonProperty(value = "properties.inputSchemaMapping") + private InputSchemaMapping inputSchemaMapping; + + /** + * Get provisioning state of the domain. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public DomainProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get endpoint for the domain. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get this determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + * + * @return the inputSchema value + */ + public InputSchema inputSchema() { + return this.inputSchema; + } + + /** + * Set this determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + * + * @param inputSchema the inputSchema value to set + * @return the DomainInner object itself. + */ + public DomainInner withInputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + return this; + } + + /** + * Get information about the InputSchemaMapping which specified the info about mapping event payload. + * + * @return the inputSchemaMapping value + */ + public InputSchemaMapping inputSchemaMapping() { + return this.inputSchemaMapping; + } + + /** + * Set information about the InputSchemaMapping which specified the info about mapping event payload. + * + * @param inputSchemaMapping the inputSchemaMapping value to set + * @return the DomainInner object itself. + */ + public DomainInner withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inputSchemaMapping = inputSchemaMapping; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysImpl.java new file mode 100644 index 0000000000000..9fb234445619b --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainSharedAccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DomainSharedAccessKeysImpl extends WrapperImpl implements DomainSharedAccessKeys { + private final EventGridManager manager; + DomainSharedAccessKeysImpl(DomainSharedAccessKeysInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String key1() { + return this.inner().key1(); + } + + @Override + public String key2() { + return this.inner().key2(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysInner.java new file mode 100644 index 0000000000000..e4ffebb850629 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainSharedAccessKeysInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shared access keys of the Domain. + */ +public class DomainSharedAccessKeysInner { + /** + * Shared access key1 for the domain. + */ + @JsonProperty(value = "key1") + private String key1; + + /** + * Shared access key2 for the domain. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get shared access key1 for the domain. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set shared access key1 for the domain. + * + * @param key1 the key1 value to set + * @return the DomainSharedAccessKeysInner object itself. + */ + public DomainSharedAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get shared access key2 for the domain. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set shared access key2 for the domain. + * + * @param key2 the key2 value to set + * @return the DomainSharedAccessKeysInner object itself. + */ + public DomainSharedAccessKeysInner withKey2(String key2) { + this.key2 = key2; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicImpl.java new file mode 100644 index 0000000000000..104b6f8996327 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopic; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopicProvisioningState; + +class DomainTopicImpl extends CreatableUpdatableImpl implements DomainTopic, DomainTopic.Definition, DomainTopic.Update { + private final EventGridManager manager; + private String resourceGroupName; + private String domainName; + private String domainTopicName; + + DomainTopicImpl(String name, EventGridManager manager) { + super(name, new DomainTopicInner()); + this.manager = manager; + // Set resource name + this.domainTopicName = name; + // + } + + DomainTopicImpl(DomainTopicInner inner, EventGridManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.domainTopicName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.domainName = IdParsingUtils.getValueFromIdByName(inner.id(), "domains"); + this.domainTopicName = IdParsingUtils.getValueFromIdByName(inner.id(), "topics"); + // + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DomainTopicsInner client = this.manager().inner().domainTopics(); + return client.createOrUpdateAsync(this.resourceGroupName, this.domainName, this.domainTopicName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DomainTopicsInner client = this.manager().inner().domainTopics(); + return client.createOrUpdateAsync(this.resourceGroupName, this.domainName, this.domainTopicName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DomainTopicsInner client = this.manager().inner().domainTopics(); + return client.getAsync(this.resourceGroupName, this.domainName, this.domainTopicName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DomainTopicProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DomainTopicImpl withExistingDomain(String resourceGroupName, String domainName) { + this.resourceGroupName = resourceGroupName; + this.domainName = domainName; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicInner.java new file mode 100644 index 0000000000000..4a36b81204971 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopicProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Domain Topic. + */ +@JsonFlatten +public class DomainTopicInner extends ProxyResource { + /** + * Provisioning state of the domain topic. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private DomainTopicProvisioningState provisioningState; + + /** + * Get provisioning state of the domain topic. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public DomainTopicProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the domain topic. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the DomainTopicInner object itself. + */ + public DomainTopicInner withProvisioningState(DomainTopicProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsImpl.java new file mode 100644 index 0000000000000..a323b80908f4d --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopic; + +class DomainTopicsImpl extends WrapperImpl implements DomainTopics { + private final EventGridManager manager; + + DomainTopicsImpl(EventGridManager manager) { + super(manager.inner().domainTopics()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public DomainTopicImpl define(String name) { + return wrapModel(name); + } + + private DomainTopicImpl wrapModel(DomainTopicInner inner) { + return new DomainTopicImpl(inner, manager()); + } + + private DomainTopicImpl wrapModel(String name) { + return new DomainTopicImpl(name, this.manager()); + } + + @Override + public Observable listByDomainAsync(final String resourceGroupName, final String domainName) { + DomainTopicsInner client = this.inner(); + return client.listByDomainAsync(resourceGroupName, domainName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DomainTopic call(DomainTopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String domainName, String domainTopicName) { + DomainTopicsInner client = this.inner(); + return client.getAsync(resourceGroupName, domainName, domainTopicName) + .map(new Func1() { + @Override + public DomainTopic call(DomainTopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String domainName, String domainTopicName) { + DomainTopicsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, domainName, domainTopicName).toCompletable(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsInner.java new file mode 100644 index 0000000000000..43ff5d315b955 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainTopicsInner.java @@ -0,0 +1,919 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DomainTopics. + */ +public class DomainTopicsInner { + /** The Retrofit service to perform REST calls. */ + private DomainTopicsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of DomainTopicsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DomainTopicsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(DomainTopicsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DomainTopics to be + * used by Retrofit to perform actually REST calls. + */ + interface DomainTopicsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("domainTopicName") String domainTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics listByDomain" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics") + Observable> listByDomain(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics listByDomainNext" }) + @GET + Observable> listByDomainNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainTopicInner object if successful. + */ + public DomainTopicInner get(String resourceGroupName, String domainName, String domainTopicName) { + return getWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().single().body(); + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable getAsync(String resourceGroupName, String domainName, String domainTopicName) { + return getWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, DomainTopicInner>() { + @Override + public DomainTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a domain topic. + * Get properties of a domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainTopicInner object if successful. + */ + public DomainTopicInner createOrUpdate(String resourceGroupName, String domainName, String domainTopicName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().last().body(); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, DomainTopicInner>() { + @Override + public DomainTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainTopicInner object if successful. + */ + public DomainTopicInner beginCreateOrUpdate(String resourceGroupName, String domainName, String domainTopicName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().single().body(); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String domainName, String domainTopicName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, DomainTopicInner>() { + @Override + public DomainTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain topic. + * Asynchronously creates or updates a new domain topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainTopicInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String domainName, String domainTopicName) { + deleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().last().body(); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String domainName, String domainTopicName) { + return deleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String domainName, String domainTopicName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).toBlocking().single().body(); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String domainName, String domainTopicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName), serviceCallback); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String domainName, String domainTopicName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, domainName, domainTopicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain topic. + * Delete existing domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainTopicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String domainName, String domainTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainTopicName == null) { + throw new IllegalArgumentException("Parameter domainTopicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, domainName, domainTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainTopicInner> object if successful. + */ + public PagedList listByDomain(final String resourceGroupName, final String domainName) { + ServiceResponse> response = listByDomainSinglePageAsync(resourceGroupName, domainName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainAsync(final String resourceGroupName, final String domainName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainSinglePageAsync(resourceGroupName, domainName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable> listByDomainAsync(final String resourceGroupName, final String domainName) { + return listByDomainWithServiceResponseAsync(resourceGroupName, domainName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable>> listByDomainWithServiceResponseAsync(final String resourceGroupName, final String domainName) { + return listByDomainSinglePageAsync(resourceGroupName, domainName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDomainNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainSinglePageAsync(final String resourceGroupName, final String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByDomain(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainTopicInner> object if successful. + */ + public PagedList listByDomain(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + ServiceResponse> response = listByDomainSinglePageAsync(resourceGroupName, domainName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainSinglePageAsync(resourceGroupName, domainName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable> listByDomainAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + return listByDomainWithServiceResponseAsync(resourceGroupName, domainName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Domain name. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable>> listByDomainWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + return listByDomainSinglePageAsync(resourceGroupName, domainName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDomainNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param domainName Domain name. + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainSinglePageAsync(final String resourceGroupName, final String domainName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDomain(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainTopicInner> object if successful. + */ + public PagedList listByDomainNext(final String nextPageLink) { + ServiceResponse> response = listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable> listByDomainNextAsync(final String nextPageLink) { + return listByDomainNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainTopicInner> object + */ + public Observable>> listByDomainNextWithServiceResponseAsync(final String nextPageLink) { + return listByDomainNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDomainNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domain topics. + * List all the topics in a domain. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDomainNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsImpl.java new file mode 100644 index 0000000000000..b8c894881f5f5 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domain; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainSharedAccessKeys; + +class DomainsImpl extends GroupableResourcesCoreImpl implements Domains { + protected DomainsImpl(EventGridManager manager) { + super(manager.inner().domains(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DomainsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DomainsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DomainsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DomainsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Domain call(DomainInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DomainsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DomainsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Domain call(DomainInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DomainImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listSharedAccessKeysAsync(String resourceGroupName, String domainName) { + DomainsInner client = this.inner(); + return client.listSharedAccessKeysAsync(resourceGroupName, domainName) + .map(new Func1() { + @Override + public DomainSharedAccessKeys call(DomainSharedAccessKeysInner inner) { + return new DomainSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String domainName, String keyName) { + DomainsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, domainName, keyName) + .map(new Func1() { + @Override + public DomainSharedAccessKeys call(DomainSharedAccessKeysInner inner) { + return new DomainSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + protected DomainImpl wrapModel(DomainInner inner) { + return new DomainImpl(inner.name(), inner, manager()); + } + + @Override + protected DomainImpl wrapModel(String name) { + return new DomainImpl(name, new DomainInner(), this.manager()); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsInner.java new file mode 100644 index 0000000000000..3a3fcff7a4d2d --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/DomainsInner.java @@ -0,0 +1,1790 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainRegenerateKeyRequest; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import 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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Domains. + */ +public class DomainsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DomainsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of DomainsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DomainsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(DomainsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Domains to be + * used by Retrofit to perform actually REST calls. + */ + interface DomainsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainInner domainInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainInner domainInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DomainUpdateParameters domainUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DomainUpdateParameters domainUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains listSharedAccessKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys") + Observable> listSharedAccessKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DomainRegenerateKeyRequest regenerateKeyRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainInner object if successful. + */ + public DomainInner getByResourceGroup(String resourceGroupName, String domainName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String domainName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a domain. + * Get properties of a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainInner object if successful. + */ + public DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domainInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).toBlocking().last().body(); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo), serviceCallback); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainInfo == null) { + throw new IllegalArgumentException("Parameter domainInfo is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(domainInfo); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainInner object if successful. + */ + public DomainInner beginCreateOrUpdate(String resourceGroupName, String domainName, DomainInner domainInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).toBlocking().single().body(); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo), serviceCallback); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a domain. + * Asynchronously creates or updates a new domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param domainInfo Domain information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (domainInfo == null) { + throw new IllegalArgumentException("Parameter domainInfo is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(domainInfo); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String domainName) { + deleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().last().body(); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String domainName) { + return deleteWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String domainName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String domainName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a domain. + * Delete existing domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainInner object if successful. + */ + public DomainInner update(String resourceGroupName, String domainName) { + return updateWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().last().body(); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String domainName) { + return updateWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); + domainUpdateParameters.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains 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 DomainInner object if successful. + */ + public DomainInner update(String resourceGroupName, String domainName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, domainName, tags).toBlocking().last().body(); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains 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 domainName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, domainName, tags), serviceCallback); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String domainName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, domainName, tags).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String domainName, 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 (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); + domainUpdateParameters.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainInner object if successful. + */ + public DomainInner beginUpdate(String resourceGroupName, String domainName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String domainName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); + domainUpdateParameters.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, 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 domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains 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 DomainInner object if successful. + */ + public DomainInner beginUpdate(String resourceGroupName, String domainName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags).toBlocking().single().body(); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains 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 domainName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags), serviceCallback); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String domainName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a domain. + * Asynchronously updates a domain with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param tags Tags of the domains resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, 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 (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); + domainUpdateParameters.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, 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 domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainInner> object if successful. + */ + public PagedList list(final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listAsync(final String filter, final Integer top) { + return listWithServiceResponseAsync(filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top) { + return listSinglePageAsync(filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainSharedAccessKeysInner object if successful. + */ + public DomainSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String domainName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSharedAccessKeysAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable listSharedAccessKeysAsync(String resourceGroupName, String domainName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainSharedAccessKeysInner>() { + @Override + public DomainSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List keys for a domain. + * List the two keys used to publish to a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable> listSharedAccessKeysWithServiceResponseAsync(String resourceGroupName, String domainName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSharedAccessKeys(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedAccessKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSharedAccessKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DomainSharedAccessKeysInner object if successful. + */ + public DomainSharedAccessKeysInner regenerateKey(String resourceGroupName, String domainName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName).toBlocking().single().body(); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param keyName Key name to regenerate key1 or key2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeyAsync(String resourceGroupName, String domainName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName), serviceCallback); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String domainName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName).map(new Func1, DomainSharedAccessKeysInner>() { + @Override + public DomainSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate key for a domain. + * Regenerate a shared access key for a domain. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the domain + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DomainSharedAccessKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String domainName, String keyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + DomainRegenerateKeyRequest regenerateKeyRequest = new DomainRegenerateKeyRequest(); + regenerateKeyRequest.withKeyName(keyName); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateKeyRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under an Azure subscription. + * List all the domains under an Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DomainInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List domains under a resource group. + * List all the domains under a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManagementClientImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManagementClientImpl.java new file mode 100644 index 0000000000000..2bd8d99ea8dbd --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManagementClientImpl.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the EventGridManagementClientImpl class. + */ +public class EventGridManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public EventGridManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public EventGridManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public EventGridManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public EventGridManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The DomainsInner object to access its operations. + */ + private DomainsInner domains; + + /** + * Gets the DomainsInner object to access its operations. + * @return the DomainsInner object. + */ + public DomainsInner domains() { + return this.domains; + } + + /** + * The DomainTopicsInner object to access its operations. + */ + private DomainTopicsInner domainTopics; + + /** + * Gets the DomainTopicsInner object to access its operations. + * @return the DomainTopicsInner object. + */ + public DomainTopicsInner domainTopics() { + return this.domainTopics; + } + + /** + * The EventSubscriptionsInner object to access its operations. + */ + private EventSubscriptionsInner eventSubscriptions; + + /** + * Gets the EventSubscriptionsInner object to access its operations. + * @return the EventSubscriptionsInner object. + */ + public EventSubscriptionsInner eventSubscriptions() { + return this.eventSubscriptions; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The TopicsInner object to access its operations. + */ + private TopicsInner topics; + + /** + * Gets the TopicsInner object to access its operations. + * @return the TopicsInner object. + */ + public TopicsInner topics() { + return this.topics; + } + + /** + * The TopicTypesInner object to access its operations. + */ + private TopicTypesInner topicTypes; + + /** + * Gets the TopicTypesInner object to access its operations. + * @return the TopicTypesInner object. + */ + public TopicTypesInner topicTypes() { + return this.topicTypes; + } + + /** + * Initializes an instance of EventGridManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public EventGridManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of EventGridManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public EventGridManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of EventGridManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public EventGridManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-02-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.domains = new DomainsInner(restClient().retrofit(), this); + this.domainTopics = new DomainTopicsInner(restClient().retrofit(), this); + this.eventSubscriptions = new EventSubscriptionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.topics = new TopicsInner(restClient().retrofit(), this); + this.topicTypes = new TopicTypesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "EventGridManagementClient", "2019-02-01-preview"); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManager.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManager.java new file mode 100644 index 0000000000000..ec66034c73467 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventGridManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Domains; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DomainTopics; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Operations; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypes; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure EventGrid resource management. + */ +public final class EventGridManager extends ManagerCore { + private Domains domains; + private DomainTopics domainTopics; + private EventSubscriptions eventSubscriptions; + private Operations operations; + private Topics topics; + private TopicTypes topicTypes; + /** + * Get a Configurable instance that can be used to create EventGridManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new EventGridManager.ConfigurableImpl(); + } + /** + * Creates an instance of EventGridManager that exposes EventGrid resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the EventGridManager + */ + public static EventGridManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new EventGridManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of EventGridManager that exposes EventGrid resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the EventGridManager + */ + public static EventGridManager authenticate(RestClient restClient, String subscriptionId) { + return new EventGridManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of EventGridManager that exposes EventGrid management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing EventGrid management API entry points that work across subscriptions + */ + EventGridManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Domains. + */ + public Domains domains() { + if (this.domains == null) { + this.domains = new DomainsImpl(this); + } + return this.domains; + } + + /** + * @return Entry point to manage DomainTopics. + */ + public DomainTopics domainTopics() { + if (this.domainTopics == null) { + this.domainTopics = new DomainTopicsImpl(this); + } + return this.domainTopics; + } + + /** + * @return Entry point to manage EventSubscriptions. + */ + public EventSubscriptions eventSubscriptions() { + if (this.eventSubscriptions == null) { + this.eventSubscriptions = new EventSubscriptionsImpl(this); + } + return this.eventSubscriptions; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Topics. + */ + public Topics topics() { + if (this.topics == null) { + this.topics = new TopicsImpl(this); + } + return this.topics; + } + + /** + * @return Entry point to manage TopicTypes. + */ + public TopicTypes topicTypes() { + if (this.topicTypes == null) { + this.topicTypes = new TopicTypesImpl(this); + } + return this.topicTypes; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public EventGridManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return EventGridManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private EventGridManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new EventGridManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlImpl.java new file mode 100644 index 0000000000000..cd4f413f06850 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionFullUrl; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventSubscriptionFullUrlImpl extends WrapperImpl implements EventSubscriptionFullUrl { + private final EventGridManager manager; + EventSubscriptionFullUrlImpl(EventSubscriptionFullUrlInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String endpointUrl() { + return this.inner().endpointUrl(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlInner.java new file mode 100644 index 0000000000000..a157be4abc5f9 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionFullUrlInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Full endpoint url of an event subscription. + */ +public class EventSubscriptionFullUrlInner { + /** + * The URL that represents the endpoint of the destination of an event + * subscription. + */ + @JsonProperty(value = "endpointUrl") + private String endpointUrl; + + /** + * Get the URL that represents the endpoint of the destination of an event subscription. + * + * @return the endpointUrl value + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the URL that represents the endpoint of the destination of an event subscription. + * + * @param endpointUrl the endpointUrl value to set + * @return the EventSubscriptionFullUrlInner object itself. + */ + public EventSubscriptionFullUrlInner withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionImpl.java new file mode 100644 index 0000000000000..18328ec12ef88 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionImpl.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionUpdateParameters; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionFilter; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventDeliverySchema; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.RetryPolicy; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DeadLetterDestination; +import rx.functions.Func1; + +class EventSubscriptionImpl extends CreatableUpdatableImpl implements EventSubscription, EventSubscription.Definition, EventSubscription.Update { + private String scope; + private String eventSubscriptionName; + private EventSubscriptionUpdateParameters updateParameter; + private final EventGridManager manager; + + EventSubscriptionImpl(String name, EventGridManager manager) { + super(name, new EventSubscriptionInner()); + this.manager = manager; + // Set resource name + this.eventSubscriptionName = name; + // + this.updateParameter = new EventSubscriptionUpdateParameters(); + } + + EventSubscriptionImpl(EventSubscriptionInner inner, EventGridManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.eventSubscriptionName = inner.name(); + // set resource ancestor and positional variables + this.eventSubscriptionName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventSubscriptions"); + this.scope = IdParsingUtils.getValueFromIdByPosition(inner.id(), 0); + // set other parameters for create and update + this.updateParameter = new EventSubscriptionUpdateParameters(); + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EventSubscriptionsInner client = this.manager().inner().eventSubscriptions(); + return client.createOrUpdateAsync(this.scope, this.eventSubscriptionName, this.inner()) + .map(new Func1() { + @Override + public EventSubscriptionInner call(EventSubscriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EventSubscriptionsInner client = this.manager().inner().eventSubscriptions(); + return client.updateAsync(this.scope, this.eventSubscriptionName, this.updateParameter) + .map(new Func1() { + @Override + public EventSubscriptionInner call(EventSubscriptionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EventSubscriptionsInner client = this.manager().inner().eventSubscriptions(); + return client.getAsync(this.scope, this.eventSubscriptionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new EventSubscriptionUpdateParameters(); + } + + @Override + public DeadLetterDestination deadLetterDestination() { + return this.inner().deadLetterDestination(); + } + + @Override + public EventSubscriptionDestination destination() { + return this.inner().destination(); + } + + @Override + public EventDeliverySchema eventDeliverySchema() { + return this.inner().eventDeliverySchema(); + } + + @Override + public DateTime expirationTimeUtc() { + return this.inner().expirationTimeUtc(); + } + + @Override + public EventSubscriptionFilter filter() { + return this.inner().filter(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List labels() { + return this.inner().labels(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public EventSubscriptionProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RetryPolicy retryPolicy() { + return this.inner().retryPolicy(); + } + + @Override + public String topic() { + return this.inner().topic(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public EventSubscriptionImpl withScope(String scope) { + this.scope = scope; + return this; + } + + @Override + public EventSubscriptionImpl withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + if (isInCreateMode()) { + this.inner().withDeadLetterDestination(deadLetterDestination); + } else { + this.updateParameter.withDeadLetterDestination(deadLetterDestination); + } + return this; + } + + @Override + public EventSubscriptionImpl withDestination(EventSubscriptionDestination destination) { + if (isInCreateMode()) { + this.inner().withDestination(destination); + } else { + this.updateParameter.withDestination(destination); + } + return this; + } + + @Override + public EventSubscriptionImpl withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + if (isInCreateMode()) { + this.inner().withEventDeliverySchema(eventDeliverySchema); + } else { + this.updateParameter.withEventDeliverySchema(eventDeliverySchema); + } + return this; + } + + @Override + public EventSubscriptionImpl withExpirationTimeUtc(DateTime expirationTimeUtc) { + if (isInCreateMode()) { + this.inner().withExpirationTimeUtc(expirationTimeUtc); + } else { + this.updateParameter.withExpirationTimeUtc(expirationTimeUtc); + } + return this; + } + + @Override + public EventSubscriptionImpl withFilter(EventSubscriptionFilter filter) { + if (isInCreateMode()) { + this.inner().withFilter(filter); + } else { + this.updateParameter.withFilter(filter); + } + return this; + } + + @Override + public EventSubscriptionImpl withLabels(List labels) { + if (isInCreateMode()) { + this.inner().withLabels(labels); + } else { + this.updateParameter.withLabels(labels); + } + return this; + } + + @Override + public EventSubscriptionImpl withRetryPolicy(RetryPolicy retryPolicy) { + if (isInCreateMode()) { + this.inner().withRetryPolicy(retryPolicy); + } else { + this.updateParameter.withRetryPolicy(retryPolicy); + } + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionInner.java new file mode 100644 index 0000000000000..b3bbd1a95085e --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionInner.java @@ -0,0 +1,245 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionDestination; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionFilter; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventDeliverySchema; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.RetryPolicy; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.DeadLetterDestination; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Event Subscription. + */ +@JsonFlatten +public class EventSubscriptionInner extends ProxyResource { + /** + * Name of the topic of the event subscription. + */ + @JsonProperty(value = "properties.topic", access = JsonProperty.Access.WRITE_ONLY) + private String topic; + + /** + * Provisioning state of the event subscription. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed', + * 'AwaitingManualAction'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EventSubscriptionProvisioningState provisioningState; + + /** + * Information about the destination where events have to be delivered for + * the event subscription. + */ + @JsonProperty(value = "properties.destination") + private EventSubscriptionDestination destination; + + /** + * Information about the filter for the event subscription. + */ + @JsonProperty(value = "properties.filter") + private EventSubscriptionFilter filter; + + /** + * List of user defined labels. + */ + @JsonProperty(value = "properties.labels") + private List labels; + + /** + * Expiration time of the event subscription. + */ + @JsonProperty(value = "properties.expirationTimeUtc") + private DateTime expirationTimeUtc; + + /** + * The event delivery schema for the event subscription. Possible values + * include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema'. + */ + @JsonProperty(value = "properties.eventDeliverySchema") + private EventDeliverySchema eventDeliverySchema; + + /** + * The retry policy for events. This can be used to configure maximum + * number of delivery attempts and time to live for events. + */ + @JsonProperty(value = "properties.retryPolicy") + private RetryPolicy retryPolicy; + + /** + * The DeadLetter destination of the event subscription. + */ + @JsonProperty(value = "properties.deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + + /** + * Get name of the topic of the event subscription. + * + * @return the topic value + */ + public String topic() { + return this.topic; + } + + /** + * Get provisioning state of the event subscription. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed', 'AwaitingManualAction'. + * + * @return the provisioningState value + */ + public EventSubscriptionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get information about the destination where events have to be delivered for the event subscription. + * + * @return the destination value + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set information about the destination where events have to be delivered for the event subscription. + * + * @param destination the destination value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get information about the filter for the event subscription. + * + * @return the filter value + */ + public EventSubscriptionFilter filter() { + return this.filter; + } + + /** + * Set information about the filter for the event subscription. + * + * @param filter the filter value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withFilter(EventSubscriptionFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get list of user defined labels. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set list of user defined labels. + * + * @param labels the labels value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get expiration time of the event subscription. + * + * @return the expirationTimeUtc value + */ + public DateTime expirationTimeUtc() { + return this.expirationTimeUtc; + } + + /** + * Set expiration time of the event subscription. + * + * @param expirationTimeUtc the expirationTimeUtc value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withExpirationTimeUtc(DateTime expirationTimeUtc) { + this.expirationTimeUtc = expirationTimeUtc; + return this; + } + + /** + * Get the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema'. + * + * @return the eventDeliverySchema value + */ + public EventDeliverySchema eventDeliverySchema() { + return this.eventDeliverySchema; + } + + /** + * Set the event delivery schema for the event subscription. Possible values include: 'EventGridSchema', 'CloudEventV01Schema', 'CustomInputSchema'. + * + * @param eventDeliverySchema the eventDeliverySchema value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + this.eventDeliverySchema = eventDeliverySchema; + return this; + } + + /** + * Get the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + * + * @param retryPolicy the retryPolicy value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get the DeadLetter destination of the event subscription. + * + * @return the deadLetterDestination value + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the DeadLetter destination of the event subscription. + * + * @param deadLetterDestination the deadLetterDestination value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsImpl.java new file mode 100644 index 0000000000000..e194eda6e7072 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsImpl.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscription; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionFullUrl; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class EventSubscriptionsImpl extends WrapperImpl implements EventSubscriptions { + private PagedListConverter converter; + private final EventGridManager manager; + + EventSubscriptionsImpl(EventGridManager manager) { + super(manager.inner().eventSubscriptions()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(EventSubscriptionInner inner) { + return Observable.just((EventSubscription) wrapModel(inner)); + } + }; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public EventSubscriptionImpl define(String name) { + return wrapModel(name); + } + + private EventSubscriptionImpl wrapModel(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + + private EventSubscriptionImpl wrapModel(String name) { + return new EventSubscriptionImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String scope, String eventSubscriptionName) { + EventSubscriptionsInner client = this.inner(); + return client.getAsync(scope, eventSubscriptionName) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String scope, String eventSubscriptionName) { + EventSubscriptionsInner client = this.inner(); + return client.deleteAsync(scope, eventSubscriptionName).toCompletable(); + } + + @Override + public Observable getFullUrlAsync(String scope, String eventSubscriptionName) { + EventSubscriptionsInner client = this.inner(); + return client.getFullUrlAsync(scope, eventSubscriptionName) + .map(new Func1() { + @Override + public EventSubscriptionFullUrl call(EventSubscriptionFullUrlInner inner) { + return new EventSubscriptionFullUrlImpl(inner, manager()); + } + }); + } + + @Override + public Observable listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listGlobalBySubscriptionForTopicTypeAsync(topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listGlobalByResourceGroupForTopicTypeAsync(resourceGroupName, topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalBySubscriptionAsync(final String location) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalBySubscriptionAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalByResourceGroupAsync(final String resourceGroupName, final String location) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalByResourceGroupAsync(resourceGroupName, location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalBySubscriptionForTopicTypeAsync(location, topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName) { + EventSubscriptionsInner client = this.inner(); + return client.listRegionalByResourceGroupForTopicTypeAsync(resourceGroupName, location, topicTypeName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + EventSubscriptionsInner client = this.inner(); + return client.listByResourceAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName) { + EventSubscriptionsInner client = this.inner(); + return client.listByDomainTopicAsync(resourceGroupName, domainName, topicName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return new EventSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public PagedList list() { + EventSubscriptionsInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + EventSubscriptionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + EventSubscriptionsInner client = this.inner(); + return converter.convert(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + EventSubscriptionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventSubscription call(EventSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsInner.java new file mode 100644 index 0000000000000..cad3172e124b8 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventSubscriptionsInner.java @@ -0,0 +1,4674 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptionUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EventSubscriptions. + */ +public class EventSubscriptionsInner implements InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private EventSubscriptionsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of EventSubscriptionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EventSubscriptionsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(EventSubscriptionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EventSubscriptions to be + * used by Retrofit to perform actually REST calls. + */ + interface EventSubscriptionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions get" }) + @GET("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> get(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions createOrUpdate" }) + @PUT("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> createOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionInner eventSubscriptionInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions beginCreateOrUpdate" }) + @PUT("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> beginCreateOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionInner eventSubscriptionInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions delete" }) + @HTTP(path = "{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions beginDelete" }) + @HTTP(path = "{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions update" }) + @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> update(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions beginUpdate" }) + @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}") + Observable> beginUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions getFullUrl" }) + @POST("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl") + Observable> getFullUrl(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listGlobalBySubscriptionForTopicType" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listGlobalBySubscriptionForTopicType(@Path("subscriptionId") String subscriptionId, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listGlobalByResourceGroupForTopicType" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listGlobalByResourceGroupForTopicType(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalBySubscription" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions") + Observable> listRegionalBySubscription(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions") + Observable> listRegionalByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalBySubscriptionForTopicType" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listRegionalBySubscriptionForTopicType(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalByResourceGroupForTopicType" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions") + Observable> listRegionalByResourceGroupForTopicType(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listByResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> listByResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerNamespace") String providerNamespace, @Path("resourceTypeName") String resourceTypeName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listByDomainTopic" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions") + Observable> listByDomainTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("label") String label, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listGlobalBySubscriptionForTopicTypeNext" }) + @GET + Observable> listGlobalBySubscriptionForTopicTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listGlobalByResourceGroupForTopicTypeNext" }) + @GET + Observable> listGlobalByResourceGroupForTopicTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalBySubscriptionNext" }) + @GET + Observable> listRegionalBySubscriptionNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalByResourceGroupNext" }) + @GET + Observable> listRegionalByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalBySubscriptionForTopicTypeNext" }) + @GET + Observable> listRegionalBySubscriptionForTopicTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listRegionalByResourceGroupForTopicTypeNext" }) + @GET + Observable> listRegionalByResourceGroupForTopicTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listByResourceNext" }) + @GET + Observable> listByResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventSubscriptions listByDomainTopicNext" }) + @GET + Observable> listByDomainTopicNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner get(String scope, String eventSubscriptionName) { + return getWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body(); + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable getAsync(String scope, String eventSubscriptionName) { + return getWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an event subscription. + * Get properties of an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable> getWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner createOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().last().body(); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo), serviceCallback); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionInfo == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(eventSubscriptionInfo); + Observable> observable = service.createOrUpdate(scope, eventSubscriptionName, eventSubscriptionInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner beginCreateOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().single().body(); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo), serviceCallback); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable beginCreateOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an event subscription. + * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + * + * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionInfo == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(eventSubscriptionInfo); + return service.beginCreateOrUpdate(scope, eventSubscriptionName, eventSubscriptionInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String scope, String eventSubscriptionName) { + deleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().last().body(); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String scope, String eventSubscriptionName) { + return deleteWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String scope, String eventSubscriptionName) { + beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body(); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String scope, String eventSubscriptionName) { + return beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an event subscription. + * Delete an existing event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner update(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().last().body(); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters), serviceCallback); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionUpdateParameters == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(eventSubscriptionUpdateParameters); + Observable> observable = service.update(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventSubscriptionInner object if successful. + */ + public EventSubscriptionInner beginUpdate(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().single().body(); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters), serviceCallback); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable beginUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).map(new Func1, EventSubscriptionInner>() { + @Override + public EventSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an event subscription. + * Asynchronously updates an existing event subscription. + * + * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription to be updated + * @param eventSubscriptionUpdateParameters Updated event subscription information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (eventSubscriptionUpdateParameters == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(eventSubscriptionUpdateParameters); + return service.beginUpdate(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventSubscriptionFullUrlInner object if successful. + */ + public EventSubscriptionFullUrlInner getFullUrl(String scope, String eventSubscriptionName) { + return getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body(); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFullUrlAsync(String scope, String eventSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionFullUrlInner object + */ + public Observable getFullUrlAsync(String scope, String eventSubscriptionName) { + return getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1, EventSubscriptionFullUrlInner>() { + @Override + public EventSubscriptionFullUrlInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get full URL of an event subscription. + * Get the full endpoint URL for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventSubscriptionFullUrlInner object + */ + public Observable> getFullUrlWithServiceResponseAsync(String scope, String eventSubscriptionName) { + if (scope == null) { + throw new IllegalArgumentException("Parameter scope is required and cannot be null."); + } + if (eventSubscriptionName == null) { + throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getFullUrl(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFullUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFullUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final String label) { + ServiceResponse> response = listSinglePageAsync(filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final String label) { + return listWithServiceResponseAsync(filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final String label) { + return listSinglePageAsync(filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalBySubscriptionForTopicType(final String topicTypeName) { + ServiceResponse> response = listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName) { + return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(final String topicTypeName) { + return listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalBySubscriptionForTopicTypeSinglePageAsync(final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalBySubscriptionForTopicType(final String topicTypeName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final String filter, final Integer top, final String label) { + return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(final String topicTypeName, final String filter, final Integer top, final String label) { + return listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + ServiceResponse> * @param topicTypeName Name of the topic type + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalBySubscriptionForTopicTypeSinglePageAsync(final String topicTypeName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalBySubscriptionForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final String label) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final String label) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalByResourceGroupForTopicType(final String resourceGroupName, final String topicTypeName) { + ServiceResponse> response = listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName) { + return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String topicTypeName) { + return listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalByResourceGroupForTopicType(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final String label) { + return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final String label) { + return listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param topicTypeName Name of the topic type + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalByResourceGroupForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscription(final String location) { + ServiceResponse> response = listRegionalBySubscriptionSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionAsync(final String location) { + return listRegionalBySubscriptionWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionWithServiceResponseAsync(final String location) { + return listRegionalBySubscriptionSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionSinglePageAsync(final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscription(final String location, final String filter, final Integer top, final String label) { + ServiceResponse> response = listRegionalBySubscriptionSinglePageAsync(location, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionAsync(final String location, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionSinglePageAsync(location, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionAsync(final String location, final String filter, final Integer top, final String label) { + return listRegionalBySubscriptionWithServiceResponseAsync(location, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionWithServiceResponseAsync(final String location, final String filter, final Integer top, final String label) { + return listRegionalBySubscriptionSinglePageAsync(location, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + ServiceResponse> * @param location Name of the location + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionSinglePageAsync(final String location, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroup(final String resourceGroupName, final String location) { + ServiceResponse> response = listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location) { + return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String location) { + return listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroup(final String resourceGroupName, final String location, final String filter, final Integer top, final String label) { + ServiceResponse> response = listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final String filter, final Integer top, final String label) { + return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String location, final String filter, final Integer top, final String label) { + return listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param location Name of the location + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionForTopicType(final String location, final String topicTypeName) { + ServiceResponse> response = listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName) { + return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(final String location, final String topicTypeName) { + return listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionForTopicTypeSinglePageAsync(final String location, final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionForTopicType(final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + return listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + ServiceResponse> * @param location Name of the location + ServiceResponse> * @param topicTypeName Name of the topic type + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionForTopicTypeSinglePageAsync(final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupForTopicType(final String resourceGroupName, final String location, final String topicTypeName) { + ServiceResponse> response = listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName) { + return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String location, final String topicTypeName) { + return listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String location, final String topicTypeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupForTopicType(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param location Name of the location + * @param topicTypeName Name of the topic type + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + return listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param location Name of the location + ServiceResponse> * @param topicTypeName Name of the topic type + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupForTopicTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + return listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerNamespace == null) { + throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."); + } + if (resourceTypeName == null) { + throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listByResource(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResource(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final String label) { + return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the resource type + * @param resourceName Name of the resource + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final String label) { + return listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param providerNamespace Namespace of the provider of the topic + ServiceResponse> * @param resourceTypeName Name of the resource type + ServiceResponse> * @param resourceName Name of the resource + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceSinglePageAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerNamespace == null) { + throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."); + } + if (resourceTypeName == null) { + throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResource(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByDomainTopic(final String resourceGroupName, final String domainName, final String topicName) { + ServiceResponse> response = listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName) { + return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByDomainTopicWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String topicName) { + return listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDomainTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainTopicSinglePageAsync(final String resourceGroupName, final String domainName, final String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String label = null; + return service.listByDomainTopic(this.client.subscriptionId(), resourceGroupName, domainName, topicName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByDomainTopic(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final String label) { + ServiceResponse> response = listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top, label).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final String label, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top, label), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final String label) { + return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName, filter, top, label) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param domainName Name of the top level domain + * @param topicName Name of the domain topic + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByDomainTopicWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final String label) { + return listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top, label) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDomainTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param domainName Name of the top level domain + ServiceResponse> * @param topicName Name of the domain topic + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + ServiceResponse> * @param label The label used to filter the results for event subscriptions list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainTopicSinglePageAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final String label) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (domainName == null) { + throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDomainTopic(this.client.subscriptionId(), resourceGroupName, domainName, topicName, this.client.apiVersion(), filter, top, label, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainTopicDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get an aggregated list of all global event subscriptions under an Azure subscription. + * List all aggregated global event subscriptions under a specific Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalBySubscriptionForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGlobalBySubscriptionForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalBySubscriptionForTopicTypeNextAsync(final String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions for a topic type. + * List all global event subscriptions under an Azure subscription for a topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listGlobalBySubscriptionForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalBySubscriptionForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalBySubscriptionForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under an Azure subscription and resource group. + * List all global event subscriptions under a specific Azure subscription and resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listGlobalByResourceGroupForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGlobalByResourceGroupForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listGlobalByResourceGroupForTopicTypeNextAsync(final String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all global event subscriptions under a resource group for a topic type. + * List all global event subscriptions under a resource group for a specific topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listGlobalByResourceGroupForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGlobalByResourceGroupForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGlobalByResourceGroupForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionNext(final String nextPageLink) { + ServiceResponse> response = listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionNextAsync(final String nextPageLink) { + return listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription. + * List all event subscriptions from the given location under a specific Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listRegionalBySubscriptionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupNextAsync(final String nextPageLink) { + return listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group. + * List all event subscriptions from the given location under a specific Azure subscription and resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listRegionalByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalBySubscriptionForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalBySubscriptionForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalBySubscriptionForTopicTypeNextAsync(final String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listRegionalBySubscriptionForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalBySubscriptionForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalBySubscriptionForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listRegionalByResourceGroupForTopicTypeNext(final String nextPageLink) { + ServiceResponse> response = listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listRegionalByResourceGroupForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listRegionalByResourceGroupForTopicTypeNextAsync(final String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all regional event subscriptions under an Azure subscription and resource group for a topic type. + * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listRegionalByResourceGroupForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRegionalByResourceGroupForTopicTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRegionalByResourceGroupForTopicTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByResourceNext(final String nextPageLink) { + ServiceResponse> response = listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByResourceNextAsync(final String nextPageLink) { + return listByResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific topic. + * List all event subscriptions that have been created for a specific topic. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventSubscriptionInner> object if successful. + */ + public PagedList listByDomainTopicNext(final String nextPageLink) { + ServiceResponse> response = listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDomainTopicNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDomainTopicNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByDomainTopicNextAsync(final String nextPageLink) { + return listByDomainTopicNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByDomainTopicNextWithServiceResponseAsync(final String nextPageLink) { + return listByDomainTopicNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDomainTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all event subscriptions for a specific domain topic. + * List all event subscriptions that have been created for a specific domain topic. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDomainTopicNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDomainTopicNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDomainTopicNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDomainTopicNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeImpl.java new file mode 100644 index 0000000000000..a905cff18dd40 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventType; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class EventTypeImpl extends WrapperImpl implements EventType { + private final EventGridManager manager; + + EventTypeImpl(EventTypeInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isInDefaultSet() { + return this.inner().isInDefaultSet(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String schemaUrl() { + return this.inner().schemaUrl(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeInner.java new file mode 100644 index 0000000000000..49c0b492fb91f --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/EventTypeInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Event Type for a subject under a topic. + */ +@JsonFlatten +public class EventTypeInner extends ProxyResource { + /** + * Display name of the event type. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Description of the event type. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Url of the schema for this event type. + */ + @JsonProperty(value = "properties.schemaUrl") + private String schemaUrl; + + /** + * IsInDefaultSet flag of the event type. + */ + @JsonProperty(value = "properties.isInDefaultSet") + private Boolean isInDefaultSet; + + /** + * Get display name of the event type. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of the event type. + * + * @param displayName the displayName value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get description of the event type. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the event type. + * + * @param description the description value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get url of the schema for this event type. + * + * @return the schemaUrl value + */ + public String schemaUrl() { + return this.schemaUrl; + } + + /** + * Set url of the schema for this event type. + * + * @param schemaUrl the schemaUrl value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withSchemaUrl(String schemaUrl) { + this.schemaUrl = schemaUrl; + return this; + } + + /** + * Get isInDefaultSet flag of the event type. + * + * @return the isInDefaultSet value + */ + public Boolean isInDefaultSet() { + return this.isInDefaultSet; + } + + /** + * Set isInDefaultSet flag of the event type. + * + * @param isInDefaultSet the isInDefaultSet value to set + * @return the EventTypeInner object itself. + */ + public EventTypeInner withIsInDefaultSet(Boolean isInDefaultSet) { + this.isInDefaultSet = isInDefaultSet; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/IdParsingUtils.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..e158e64a4f528 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationImpl.java new file mode 100644 index 0000000000000..4d3b873a46103 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.OperationInfo; + +class OperationImpl extends WrapperImpl implements Operation { + private final EventGridManager manager; + OperationImpl(OperationInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public OperationInfo display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..4a9b9223abc1f --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationInner.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.OperationInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an operation returned by the GetOperations request. + */ +public class OperationInner { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of the operation. + */ + @JsonProperty(value = "display") + private OperationInfo display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of the operation. + * + * @return the display value + */ + public OperationInfo display() { + return this.display; + } + + /** + * Set display name of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationInfo display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..a8a29dc43eb94 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final EventGridManager manager; + + OperationsImpl(EventGridManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..067256bf0703e --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/OperationsInner.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Operations list" }) + @GET("providers/Microsoft.EventGrid/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List available operations. + * List the available operations supported by the Microsoft.EventGrid resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..42f9d876d1787 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl1.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl1.java new file mode 100644 index 0000000000000..580741c859be6 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicImpl.java new file mode 100644 index 0000000000000..2c9eb2667c5ae --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topic; +import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchema; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchemaMapping; + +class TopicImpl extends GroupableResourceCoreImpl implements Topic, Topic.Definition, Topic.Update { + TopicImpl(String name, TopicInner inner, EventGridManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public InputSchema inputSchema() { + return this.inner().inputSchema(); + } + + @Override + public InputSchemaMapping inputSchemaMapping() { + return this.inner().inputSchemaMapping(); + } + + @Override + public TopicProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public TopicImpl withInputSchema(InputSchema inputSchema) { + this.inner().withInputSchema(inputSchema); + return this; + } + + @Override + public TopicImpl withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inner().withInputSchemaMapping(inputSchemaMapping); + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicInner.java new file mode 100644 index 0000000000000..cc3a515a250e2 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchema; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.InputSchemaMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * EventGrid Topic. + */ +@JsonFlatten +public class TopicInner extends Resource { + /** + * Provisioning state of the topic. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private TopicProvisioningState provisioningState; + + /** + * Endpoint for the topic. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * This determines the format that Event Grid should expect for incoming + * events published to the topic. Possible values include: + * 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + */ + @JsonProperty(value = "properties.inputSchema") + private InputSchema inputSchema; + + /** + * This enables publishing using custom event schemas. An + * InputSchemaMapping can be specified to map various properties of a + * source schema to various required properties of the EventGridEvent + * schema. + */ + @JsonProperty(value = "properties.inputSchemaMapping") + private InputSchemaMapping inputSchemaMapping; + + /** + * Get provisioning state of the topic. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public TopicProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get endpoint for the topic. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get this determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + * + * @return the inputSchema value + */ + public InputSchema inputSchema() { + return this.inputSchema; + } + + /** + * Set this determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + * + * @param inputSchema the inputSchema value to set + * @return the TopicInner object itself. + */ + public TopicInner withInputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + return this; + } + + /** + * Get this enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema. + * + * @return the inputSchemaMapping value + */ + public InputSchemaMapping inputSchemaMapping() { + return this.inputSchemaMapping; + } + + /** + * Set this enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema. + * + * @param inputSchemaMapping the inputSchemaMapping value to set + * @return the TopicInner object itself. + */ + public TopicInner withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inputSchemaMapping = inputSchemaMapping; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysImpl.java new file mode 100644 index 0000000000000..da015bb95a77b --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicSharedAccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TopicSharedAccessKeysImpl extends WrapperImpl implements TopicSharedAccessKeys { + private final EventGridManager manager; + TopicSharedAccessKeysImpl(TopicSharedAccessKeysInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String key1() { + return this.inner().key1(); + } + + @Override + public String key2() { + return this.inner().key2(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysInner.java new file mode 100644 index 0000000000000..eb276b5296982 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicSharedAccessKeysInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shared access keys of the Topic. + */ +public class TopicSharedAccessKeysInner { + /** + * Shared access key1 for the topic. + */ + @JsonProperty(value = "key1") + private String key1; + + /** + * Shared access key2 for the topic. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get shared access key1 for the topic. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set shared access key1 for the topic. + * + * @param key1 the key1 value to set + * @return the TopicSharedAccessKeysInner object itself. + */ + public TopicSharedAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get shared access key2 for the topic. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set shared access key2 for the topic. + * + * @param key2 the key2 value to set + * @return the TopicSharedAccessKeysInner object itself. + */ + public TopicSharedAccessKeysInner withKey2(String key2) { + this.key2 = key2; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoImpl.java new file mode 100644 index 0000000000000..4a4ab325bcb86 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypeInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypeProvisioningState; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.ResourceRegionType; +import java.util.List; + +class TopicTypeInfoImpl extends WrapperImpl implements TopicTypeInfo { + private final EventGridManager manager; + TopicTypeInfoImpl(TopicTypeInfoInner inner, EventGridManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventGridManager manager() { + return this.manager; + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provider() { + return this.inner().provider(); + } + + @Override + public TopicTypeProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ResourceRegionType resourceRegionType() { + return this.inner().resourceRegionType(); + } + + @Override + public List supportedLocations() { + return this.inner().supportedLocations(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoInner.java new file mode 100644 index 0000000000000..1a9399350f3e3 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypeInfoInner.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.ResourceRegionType; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypeProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Properties of a topic type info. + */ +@JsonFlatten +public class TopicTypeInfoInner extends ProxyResource { + /** + * Namespace of the provider of the topic type. + */ + @JsonProperty(value = "properties.provider") + private String provider; + + /** + * Display Name for the topic type. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Description of the topic type. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Region type of the resource. Possible values include: + * 'RegionalResource', 'GlobalResource'. + */ + @JsonProperty(value = "properties.resourceRegionType") + private ResourceRegionType resourceRegionType; + + /** + * Provisioning state of the topic type. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private TopicTypeProvisioningState provisioningState; + + /** + * List of locations supported by this topic type. + */ + @JsonProperty(value = "properties.supportedLocations") + private List supportedLocations; + + /** + * Get namespace of the provider of the topic type. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set namespace of the provider of the topic type. + * + * @param provider the provider value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get display Name for the topic type. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display Name for the topic type. + * + * @param displayName the displayName value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get description of the topic type. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the topic type. + * + * @param description the description value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get region type of the resource. Possible values include: 'RegionalResource', 'GlobalResource'. + * + * @return the resourceRegionType value + */ + public ResourceRegionType resourceRegionType() { + return this.resourceRegionType; + } + + /** + * Set region type of the resource. Possible values include: 'RegionalResource', 'GlobalResource'. + * + * @param resourceRegionType the resourceRegionType value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withResourceRegionType(ResourceRegionType resourceRegionType) { + this.resourceRegionType = resourceRegionType; + return this; + } + + /** + * Get provisioning state of the topic type. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public TopicTypeProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the topic type. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withProvisioningState(TopicTypeProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get list of locations supported by this topic type. + * + * @return the supportedLocations value + */ + public List supportedLocations() { + return this.supportedLocations; + } + + /** + * Set list of locations supported by this topic type. + * + * @param supportedLocations the supportedLocations value to set + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withSupportedLocations(List supportedLocations) { + this.supportedLocations = supportedLocations; + return this; + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesImpl.java new file mode 100644 index 0000000000000..3d9a36f1076bd --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypes; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventType; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypeInfo; + +class TopicTypesImpl extends WrapperImpl implements TopicTypes { + private final EventGridManager manager; + + TopicTypesImpl(EventGridManager manager) { + super(manager.inner().topicTypes()); + this.manager = manager; + } + + public EventGridManager manager() { + return this.manager; + } + + private EventTypeImpl wrapModel(EventTypeInner inner) { + return new EventTypeImpl(inner, manager()); + } + + @Override + public Observable listEventTypesAsync(String topicTypeName) { + TopicTypesInner client = this.inner(); + return client.listEventTypesAsync(topicTypeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventType call(EventTypeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String topicTypeName) { + TopicTypesInner client = this.inner(); + return client.getAsync(topicTypeName) + .map(new Func1() { + @Override + public TopicTypeInfo call(TopicTypeInfoInner inner) { + return new TopicTypeInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + TopicTypesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public TopicTypeInfo call(TopicTypeInfoInner inner) { + return new TopicTypeInfoImpl(inner, manager()); + } + }); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesInner.java new file mode 100644 index 0000000000000..34af0100ea991 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicTypesInner.java @@ -0,0 +1,312 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TopicTypes. + */ +public class TopicTypesInner { + /** The Retrofit service to perform REST calls. */ + private TopicTypesService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of TopicTypesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TopicTypesInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(TopicTypesService.class); + this.client = client; + } + + /** + * The interface defining all the services for TopicTypes to be + * used by Retrofit to perform actually REST calls. + */ + interface TopicTypesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypes list" }) + @GET("providers/Microsoft.EventGrid/topicTypes") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypes get" }) + @GET("providers/Microsoft.EventGrid/topicTypes/{topicTypeName}") + Observable> get(@Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicTypes listEventTypes" }) + @GET("providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes") + Observable> listEventTypes(@Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<TopicTypeInfoInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List topic types. + * List all registered topic types. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TopicTypeInfoInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topic types. + * List all registered topic types. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TopicTypeInfoInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopicTypeInfoInner object if successful. + */ + public TopicTypeInfoInner get(String topicTypeName) { + return getWithServiceResponseAsync(topicTypeName).toBlocking().single().body(); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String topicTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(topicTypeName), serviceCallback); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicTypeInfoInner object + */ + public Observable getAsync(String topicTypeName) { + return getWithServiceResponseAsync(topicTypeName).map(new Func1, TopicTypeInfoInner>() { + @Override + public TopicTypeInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a topic type. + * Get information about a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicTypeInfoInner object + */ + public Observable> getWithServiceResponseAsync(String topicTypeName) { + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<EventTypeInner> object if successful. + */ + public List listEventTypes(String topicTypeName) { + return listEventTypesWithServiceResponseAsync(topicTypeName).toBlocking().single().body(); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventTypesAsync(String topicTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listEventTypesWithServiceResponseAsync(topicTypeName), serviceCallback); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable> listEventTypesAsync(String topicTypeName) { + return listEventTypesWithServiceResponseAsync(topicTypeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List event types. + * List event types for a topic type. + * + * @param topicTypeName Name of the topic type + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable>> listEventTypesWithServiceResponseAsync(String topicTypeName) { + if (topicTypeName == null) { + throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listEventTypes(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventTypesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventTypesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsImpl.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsImpl.java new file mode 100644 index 0000000000000..88e33492cd894 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topic; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicSharedAccessKeys; +import java.util.List; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.EventType; + +class TopicsImpl extends GroupableResourcesCoreImpl implements Topics { + protected TopicsImpl(EventGridManager manager) { + super(manager.inner().topics(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + TopicsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + TopicsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + TopicsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + TopicsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Topic call(TopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + TopicsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + TopicsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Topic call(TopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public TopicImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listSharedAccessKeysAsync(String resourceGroupName, String topicName) { + TopicsInner client = this.inner(); + return client.listSharedAccessKeysAsync(resourceGroupName, topicName) + .map(new Func1() { + @Override + public TopicSharedAccessKeys call(TopicSharedAccessKeysInner inner) { + return new TopicSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String topicName, String keyName) { + TopicsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, topicName, keyName) + .map(new Func1() { + @Override + public TopicSharedAccessKeys call(TopicSharedAccessKeysInner inner) { + return new TopicSharedAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + protected TopicImpl wrapModel(TopicInner inner) { + return new TopicImpl(inner.name(), inner, manager()); + } + + @Override + protected TopicImpl wrapModel(String name) { + return new TopicImpl(name, new TopicInner(), this.manager()); + } + + @Override + public Observable listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + TopicsInner client = this.inner(); + return client.listEventTypesAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public EventType call(EventTypeInner inner) { + return new EventTypeImpl(inner, manager()); + } + }); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsInner.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsInner.java new file mode 100644 index 0000000000000..3a01df1f2f937 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/TopicsInner.java @@ -0,0 +1,1903 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.TopicRegenerateKeyRequest; +import com.microsoft.azure.management.eventgrid.v2019_02_01_preview.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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Topics. + */ +public class TopicsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private TopicsService service; + /** The service client containing this operation class. */ + private EventGridManagementClientImpl client; + + /** + * Initializes an instance of TopicsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TopicsInner(Retrofit retrofit, EventGridManagementClientImpl client) { + this.service = retrofit.create(TopicsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Topics to be + * used by Retrofit to perform actually REST calls. + */ + interface TopicsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicInner topicInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicInner topicInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicUpdateParameters topicUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicUpdateParameters topicUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics listSharedAccessKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys") + Observable> listSharedAccessKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicRegenerateKeyRequest regenerateKeyRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics listEventTypes" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes") + Observable> listEventTypes(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerNamespace") String providerNamespace, @Path("resourceTypeName") String resourceTypeName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_02_01_preview.Topics listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopicInner object if successful. + */ + public TopicInner getByResourceGroup(String resourceGroupName, String topicName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String topicName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a topic. + * Get properties of a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopicInner object if successful. + */ + public TopicInner createOrUpdate(String resourceGroupName, String topicName, TopicInner topicInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).toBlocking().last().body(); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo), serviceCallback); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (topicInfo == null) { + throw new IllegalArgumentException("Parameter topicInfo is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(topicInfo); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, topicName, topicInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopicInner object if successful. + */ + public TopicInner beginCreateOrUpdate(String resourceGroupName, String topicName, TopicInner topicInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).toBlocking().single().body(); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo), serviceCallback); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).map(new Func1, TopicInner>() { + @Override + public TopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a topic. + * Asynchronously creates a new topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param topicInfo Topic information + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (topicInfo == null) { + throw new IllegalArgumentException("Parameter topicInfo is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(topicInfo); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, topicName, topicInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String topicName) { + deleteWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().last().body(); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String topicName) { + return deleteWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String topicName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String topicName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a topic. + * Delete existing topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a topic. + * Asynchronously updates a topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TopicInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TopicInner> object if successful. + */ + public PagedList list(final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listAsync(final String filter, final Integer top) { + return listWithServiceResponseAsync(filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top) { + return listSinglePageAsync(filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TopicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TopicInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter Filter the results using OData syntax. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param filter Filter the results using OData syntax. + ServiceResponse> * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopicSharedAccessKeysInner object if successful. + */ + public TopicSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String topicName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSharedAccessKeysAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable listSharedAccessKeysAsync(String resourceGroupName, String topicName) { + return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, TopicSharedAccessKeysInner>() { + @Override + public TopicSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List keys for a topic. + * List the two keys used to publish to a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable> listSharedAccessKeysWithServiceResponseAsync(String resourceGroupName, String topicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSharedAccessKeys(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedAccessKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSharedAccessKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopicSharedAccessKeysInner object if successful. + */ + public TopicSharedAccessKeysInner regenerateKey(String resourceGroupName, String topicName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, topicName, keyName).toBlocking().single().body(); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param keyName Key name to regenerate key1 or key2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeyAsync(String resourceGroupName, String topicName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, topicName, keyName), serviceCallback); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String topicName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, topicName, keyName).map(new Func1, TopicSharedAccessKeysInner>() { + @Override + public TopicSharedAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate key for a topic. + * Regenerate a shared access key for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param topicName Name of the topic + * @param keyName Key name to regenerate key1 or key2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopicSharedAccessKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String topicName, String keyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + TopicRegenerateKeyRequest regenerateKeyRequest = new TopicRegenerateKeyRequest(); + regenerateKeyRequest.withKeyName(keyName); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateKeyRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the topic type + * @param resourceName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<EventTypeInner> object if successful. + */ + public List listEventTypes(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body(); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the topic type + * @param resourceName Name of the topic + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName), serviceCallback); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the topic type + * @param resourceName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable> listEventTypesAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topic event types. + * List event types for a topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param providerNamespace Namespace of the provider of the topic + * @param resourceTypeName Name of the topic type + * @param resourceName Name of the topic + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<EventTypeInner> object + */ + public Observable>> listEventTypesWithServiceResponseAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerNamespace == null) { + throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."); + } + if (resourceTypeName == null) { + throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listEventTypes(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventTypesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventTypesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TopicInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under an Azure subscription. + * List all the topics under an Azure subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TopicInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TopicInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List topics under a resource group. + * List all the topics under a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/package-info.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..6791eb72575da --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for EventGridManagementClient. + * Azure EventGrid Management Client. + */ +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview.implementation; diff --git a/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/package-info.java b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/package-info.java new file mode 100644 index 0000000000000..23c28f9fd4a41 --- /dev/null +++ b/eventgrid/resource-manager/v2019_02_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2019_02_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for EventGridManagementClient. + * Azure EventGrid Management Client. + */ +package com.microsoft.azure.management.eventgrid.v2019_02_01_preview;