From f734e4a7d458165dc0970c34292cf9220b388d8f Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 27 Oct 2020 06:19:04 +0000 Subject: [PATCH] Generated from 29557e94b3ab81cfc02b8b849bc2074409c535ca --- .../mgmt-v2018_01_01_preview/pom.xml | 4 +- .../v2018_01_01_preview/AccessKeys.java | 55 + .../v2018_01_01_preview/AccessRights.java | 56 + .../v2018_01_01_preview/Action.java | 97 + .../ArmDisasterRecovery.java | 161 ++ .../CaptureDescription.java | 152 + .../CheckNameAvailability.java | 45 + .../CheckNameAvailabilityResult.java | 35 + .../v2018_01_01_preview/ConnectionState.java | 70 + .../CorrelationFilter.java | 278 ++ .../v2018_01_01_preview/Destination.java | 126 + ...eryConfigNamespaceSBAuthorizationRule.java | 43 + .../DisasterRecoveryConfigs.java | 122 + .../EncodingCaptureDescription.java | 53 + .../v2018_01_01_preview/Encryption.java | 70 + .../EndPointProvisioningState.java | 53 + .../v2018_01_01_preview/EntityStatus.java | 74 + .../ErrorAdditionalInfo.java | 47 + .../v2018_01_01_preview/ErrorResponse.java | 51 +- .../ErrorResponseError.java | 93 + .../v2018_01_01_preview/EventHubs.java | 29 + .../v2018_01_01_preview/Eventhub.java | 72 + .../v2018_01_01_preview/FilterType.java | 53 + .../v2018_01_01_preview/Identity.java | 96 + .../v2018_01_01_preview/IdentityType.java | 50 + .../v2018_01_01_preview/KeySource.java | 50 + .../v2018_01_01_preview/KeyType.java | 53 + .../KeyVaultProperties.java | 69 + .../MessageCountDetails.java | 92 + .../MigrationConfigProperties.java | 137 + .../v2018_01_01_preview/MigrationConfigs.java | 71 + .../v2018_01_01_preview/NameSpaceType.java | 62 + .../NamespaceSBAuthorizationRule.java | 118 + .../v2018_01_01_preview/Namespaces.java | 97 +- .../v2018_01_01_preview/NetworkRuleSet.java | 5 + .../PremiumMessagingRegion.java | 28 + .../PremiumMessagingRegionProperties.java | 47 + .../PremiumMessagingRegions.java | 19 + .../v2018_01_01_preview/PrivateEndpoint.java | 43 + .../PrivateEndpointConnection.java | 175 ++ .../PrivateEndpointConnections.java | 53 + .../PrivateLinkConnectionStatus.java | 47 + .../PrivateLinkResources.java | 29 + .../PrivateLinkResourcesListResult.java | 32 + .../ProvisioningStateDR.java | 56 + .../QueueNamespaceSBAuthorizationRule.java | 119 + .../v2018_01_01_preview/Queues.java | 121 + .../RegenerateAccessKeyParameters.java | 72 + .../v2018_01_01_preview/Regions.java | 28 + .../RoleDisasterRecovery.java | 56 + .../servicebus/v2018_01_01_preview/Rule.java | 206 ++ .../servicebus/v2018_01_01_preview/Rules.java | 59 + .../v2018_01_01_preview/SBNamespace.java | 62 +- .../SBNamespaceMigrate.java | 44 + .../SBNamespaceUpdateParameters.java | 52 + .../v2018_01_01_preview/SBQueue.java | 555 ++++ .../v2018_01_01_preview/SBSubscription.java | 464 +++ .../v2018_01_01_preview/SBTopic.java | 410 +++ .../v2018_01_01_preview/SqlFilter.java | 97 + .../v2018_01_01_preview/SqlRuleAction.java | 17 + .../v2018_01_01_preview/Subscriptions.java | 56 + .../TopicNamespaceSBAuthorizationRule.java | 119 + .../v2018_01_01_preview/Topics.java | 121 + .../UnavailableReason.java | 65 + .../implementation/AccessKeysImpl.java | 61 + .../implementation/AccessKeysInner.java | 124 + .../ArmDisasterRecoveryImpl.java | 133 + .../ArmDisasterRecoveryInner.java | 125 + .../CheckNameAvailabilityResultImpl.java | 42 + .../CheckNameAvailabilityResultInner.java | 88 + ...onfigNamespaceSBAuthorizationRuleImpl.java | 67 + .../DisasterRecoveryConfigsImpl.java | 171 ++ .../DisasterRecoveryConfigsInner.java | 1338 +++++++++ .../implementation/EventHubsImpl.java | 53 + .../implementation/EventHubsInner.java | 301 ++ .../implementation/EventhubImpl.java | 84 + .../implementation/EventhubInner.java | 177 ++ .../MigrationConfigPropertiesImpl.java | 129 + .../MigrationConfigPropertiesInner.java | 119 + .../implementation/MigrationConfigsImpl.java | 97 + .../implementation/MigrationConfigsInner.java | 840 ++++++ .../NamespaceSBAuthorizationRuleImpl.java | 113 + .../implementation/NamespacesImpl.java | 150 +- .../implementation/NamespacesInner.java | 2568 +++++++++++------ .../implementation/NetworkRuleSetImpl.java | 5 + .../implementation/NetworkRuleSetInner.java | 26 + .../implementation/OperationsInner.java | 8 +- .../PremiumMessagingRegionImpl.java | 46 + .../PremiumMessagingRegionInner.java | 45 + .../PremiumMessagingRegionsImpl.java | 71 + .../PremiumMessagingRegionsInner.java | 285 ++ .../PrivateEndpointConnectionImpl.java | 130 + .../PrivateEndpointConnectionInner.java | 103 + .../PrivateEndpointConnectionsImpl.java | 85 + .../PrivateEndpointConnectionsInner.java | 678 +++++ .../PrivateLinkResourceInner.java | 176 ++ .../PrivateLinkResourcesImpl.java | 42 + .../PrivateLinkResourcesInner.java | 144 + .../PrivateLinkResourcesListResultImpl.java | 37 + .../PrivateLinkResourcesListResultInner.java | 70 + ...QueueNamespaceSBAuthorizationRuleImpl.java | 116 + .../implementation/QueuesImpl.java | 174 ++ .../implementation/QueuesInner.java | 1504 ++++++++++ .../implementation/RegionsImpl.java | 49 + .../implementation/RegionsInner.java | 293 ++ .../implementation/RuleImpl.java | 148 + .../implementation/RuleInner.java | 130 + .../implementation/RulesImpl.java | 85 + .../implementation/RulesInner.java | 799 +++++ .../SBAuthorizationRuleInner.java | 48 + .../implementation/SBNamespaceImpl.java | 32 + .../implementation/SBNamespaceInner.java | 54 + .../implementation/SBQueueImpl.java | 293 ++ .../implementation/SBQueueInner.java | 522 ++++ .../implementation/SBSubscriptionImpl.java | 258 ++ .../implementation/SBSubscriptionInner.java | 422 +++ .../implementation/SBTopicImpl.java | 238 ++ .../implementation/SBTopicInner.java | 387 +++ .../ServiceBusManagementClientImpl.java | 183 +- .../implementation/ServiceBusManager.java | 146 +- .../implementation/SubscriptionsImpl.java | 85 + .../implementation/SubscriptionsInner.java | 762 +++++ ...TopicNamespaceSBAuthorizationRuleImpl.java | 116 + .../implementation/TopicsImpl.java | 174 ++ .../implementation/TopicsInner.java | 1504 ++++++++++ .../implementation/package-info.java | 1 - .../v2018_01_01_preview/package-info.java | 1 - 127 files changed, 22300 insertions(+), 946 deletions(-) create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessKeys.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessRights.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Action.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ArmDisasterRecovery.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CaptureDescription.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailability.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailabilityResult.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ConnectionState.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CorrelationFilter.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Destination.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigNamespaceSBAuthorizationRule.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigs.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EncodingCaptureDescription.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Encryption.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EndPointProvisioningState.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EntityStatus.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorAdditionalInfo.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponseError.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EventHubs.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Eventhub.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/FilterType.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Identity.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/IdentityType.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeySource.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyType.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyVaultProperties.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MessageCountDetails.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigProperties.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigs.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NameSpaceType.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NamespaceSBAuthorizationRule.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegion.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegionProperties.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegions.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpoint.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnection.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnections.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkConnectionStatus.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResources.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResourcesListResult.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ProvisioningStateDR.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/QueueNamespaceSBAuthorizationRule.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Queues.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RegenerateAccessKeyParameters.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Regions.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RoleDisasterRecovery.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rule.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rules.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceMigrate.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBQueue.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBSubscription.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBTopic.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlFilter.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlRuleAction.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Subscriptions.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/TopicNamespaceSBAuthorizationRule.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Topics.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/UnavailableReason.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespaceSBAuthorizationRuleImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourceInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueueNamespaceSBAuthorizationRuleImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBAuthorizationRuleInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsInner.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicNamespaceSBAuthorizationRuleImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsImpl.java create mode 100644 sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsInner.java diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/pom.xml b/sdk/servicebus/mgmt-v2018_01_01_preview/pom.xml index 7a91f1dbfb1e..68c64ab067a8 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/pom.xml +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-servicebus 1.0.0-beta diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessKeys.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessKeys.java new file mode 100644 index 000000000000..522020b0a042 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessKeys.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.AccessKeysInner; + +/** + * Type representing AccessKeys. + */ +public interface AccessKeys extends HasInner, HasManager { + /** + * @return the aliasPrimaryConnectionString value. + */ + String aliasPrimaryConnectionString(); + + /** + * @return the aliasSecondaryConnectionString value. + */ + String aliasSecondaryConnectionString(); + + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessRights.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessRights.java new file mode 100644 index 000000000000..ea197c3275f4 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/AccessRights.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessRights. + */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Action.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Action.java new file mode 100644 index 000000000000..23503cf3cc49 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Action.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the filter actions which are allowed for the transformation of a + * message that have been matched by a filter expression. + */ +public class Action { + /** + * SQL expression. e.g. MyProperty='ABC'. + */ + @JsonProperty(value = "sqlExpression") + private String sqlExpression; + + /** + * This property is reserved for future use. An integer value showing the + * compatibility level, currently hard-coded to 20. + */ + @JsonProperty(value = "compatibilityLevel") + private Integer compatibilityLevel; + + /** + * Value that indicates whether the rule action requires preprocessing. + */ + @JsonProperty(value = "requiresPreprocessing") + private Boolean requiresPreprocessing; + + /** + * Get sQL expression. e.g. MyProperty='ABC'. + * + * @return the sqlExpression value + */ + public String sqlExpression() { + return this.sqlExpression; + } + + /** + * Set sQL expression. e.g. MyProperty='ABC'. + * + * @param sqlExpression the sqlExpression value to set + * @return the Action object itself. + */ + public Action withSqlExpression(String sqlExpression) { + this.sqlExpression = sqlExpression; + return this; + } + + /** + * Get this property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. + * + * @return the compatibilityLevel value + */ + public Integer compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set this property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. + * + * @param compatibilityLevel the compatibilityLevel value to set + * @return the Action object itself. + */ + public Action withCompatibilityLevel(Integer compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set value that indicates whether the rule action requires preprocessing. + * + * @param requiresPreprocessing the requiresPreprocessing value to set + * @return the Action object itself. + */ + public Action withRequiresPreprocessing(Boolean requiresPreprocessing) { + this.requiresPreprocessing = requiresPreprocessing; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ArmDisasterRecovery.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ArmDisasterRecovery.java new file mode 100644 index 000000000000..0bdb81875540 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ArmDisasterRecovery.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ArmDisasterRecoveryInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; + +/** + * Type representing ArmDisasterRecovery. + */ +public interface ArmDisasterRecovery extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternateName value. + */ + String alternateName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partnerNamespace value. + */ + String partnerNamespace(); + + /** + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * @return the provisioningState value. + */ + ProvisioningStateDR provisioningState(); + + /** + * @return the role value. + */ + RoleDisasterRecovery role(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ArmDisasterRecovery definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of ArmDisasterRecovery definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ArmDisasterRecovery definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the armdisasterrecovery definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the armdisasterrecovery definition allowing to specify AlternateName. + */ + interface WithAlternateName { + /** + * Specifies alternateName. + * @param alternateName Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + * @return the next definition stage + */ + WithCreate withAlternateName(String alternateName); + } + + /** + * The stage of the armdisasterrecovery definition allowing to specify PartnerNamespace. + */ + interface WithPartnerNamespace { + /** + * Specifies partnerNamespace. + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + * @return the next definition stage + */ + WithCreate withPartnerNamespace(String partnerNamespace); + } + + /** + * 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.WithAlternateName, DefinitionStages.WithPartnerNamespace { + } + } + /** + * The template for a ArmDisasterRecovery update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternateName, UpdateStages.WithPartnerNamespace { + } + + /** + * Grouping of ArmDisasterRecovery update stages. + */ + interface UpdateStages { + /** + * The stage of the armdisasterrecovery update allowing to specify AlternateName. + */ + interface WithAlternateName { + /** + * Specifies alternateName. + * @param alternateName Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + * @return the next update stage + */ + Update withAlternateName(String alternateName); + } + + /** + * The stage of the armdisasterrecovery update allowing to specify PartnerNamespace. + */ + interface WithPartnerNamespace { + /** + * Specifies partnerNamespace. + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + * @return the next update stage + */ + Update withPartnerNamespace(String partnerNamespace); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CaptureDescription.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CaptureDescription.java new file mode 100644 index 000000000000..6d9a152850aa --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CaptureDescription.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure capture description for eventhub. + */ +public class CaptureDescription { + /** + * A value that indicates whether capture description is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Enumerates the possible values for the encoding format of capture + * description. Possible values include: 'Avro', 'AvroDeflate'. + */ + @JsonProperty(value = "encoding") + private EncodingCaptureDescription encoding; + + /** + * The time window allows you to set the frequency with which the capture + * to Azure Blobs will happen, value should between 60 to 900 seconds. + */ + @JsonProperty(value = "intervalInSeconds") + private Integer intervalInSeconds; + + /** + * The size window defines the amount of data built up in your Event Hub + * before an capture operation, value should be between 10485760 and + * 524288000 bytes. + */ + @JsonProperty(value = "sizeLimitInBytes") + private Integer sizeLimitInBytes; + + /** + * Properties of Destination where capture will be stored. (Storage + * Account, Blob Names). + */ + @JsonProperty(value = "destination") + private Destination destination; + + /** + * Get a value that indicates whether capture description is enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set a value that indicates whether capture description is enabled. + * + * @param enabled the enabled value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enumerates the possible values for the encoding format of capture description. Possible values include: 'Avro', 'AvroDeflate'. + * + * @return the encoding value + */ + public EncodingCaptureDescription encoding() { + return this.encoding; + } + + /** + * Set enumerates the possible values for the encoding format of capture description. Possible values include: 'Avro', 'AvroDeflate'. + * + * @param encoding the encoding value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withEncoding(EncodingCaptureDescription encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds. + * + * @return the intervalInSeconds value + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 and 524288000 bytes. + * + * @return the sizeLimitInBytes value + */ + public Integer sizeLimitInBytes() { + return this.sizeLimitInBytes; + } + + /** + * Set the size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 and 524288000 bytes. + * + * @param sizeLimitInBytes the sizeLimitInBytes value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withSizeLimitInBytes(Integer sizeLimitInBytes) { + this.sizeLimitInBytes = sizeLimitInBytes; + return this; + } + + /** + * Get properties of Destination where capture will be stored. (Storage Account, Blob Names). + * + * @return the destination value + */ + public Destination destination() { + return this.destination; + } + + /** + * Set properties of Destination where capture will be stored. (Storage Account, Blob Names). + * + * @param destination the destination value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withDestination(Destination destination) { + this.destination = destination; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailability.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailability.java new file mode 100644 index 000000000000..ee03c2d3e3ab --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailability.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a Check Name availability request properties. + */ +public class CheckNameAvailability { + /** + * The Name to check the namespace name availability and The namespace name + * can contain only letters, numbers, and hyphens. The namespace must start + * with a letter, and it must end with a letter or number. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * + * @param name the name value to set + * @return the CheckNameAvailability object itself. + */ + public CheckNameAvailability withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailabilityResult.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..5e35da63f12e --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CheckNameAvailabilityResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + UnavailableReason reason(); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ConnectionState.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ConnectionState.java new file mode 100644 index 000000000000..efdc68319d69 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ConnectionState.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ConnectionState information. + */ +public class ConnectionState { + /** + * Status of the connection. Possible values include: 'Pending', + * 'Approved', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private PrivateLinkConnectionStatus status; + + /** + * Description of the connection state. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get status of the connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PrivateLinkConnectionStatus status() { + return this.status; + } + + /** + * Set status of the connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the ConnectionState object itself. + */ + public ConnectionState withStatus(PrivateLinkConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get description of the connection state. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the connection state. + * + * @param description the description value to set + * @return the ConnectionState object itself. + */ + public ConnectionState withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CorrelationFilter.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CorrelationFilter.java new file mode 100644 index 000000000000..2d86e254540e --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/CorrelationFilter.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the correlation filter expression. + */ +public class CorrelationFilter { + /** + * dictionary object for custom filters. + */ + @JsonProperty(value = "properties") + private Map properties; + + /** + * Identifier of the correlation. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * Identifier of the message. + */ + @JsonProperty(value = "messageId") + private String messageId; + + /** + * Address to send to. + */ + @JsonProperty(value = "to") + private String to; + + /** + * Address of the queue to reply to. + */ + @JsonProperty(value = "replyTo") + private String replyTo; + + /** + * Application specific label. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Session identifier. + */ + @JsonProperty(value = "sessionId") + private String sessionId; + + /** + * Session identifier to reply to. + */ + @JsonProperty(value = "replyToSessionId") + private String replyToSessionId; + + /** + * Content type of the message. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * Value that indicates whether the rule action requires preprocessing. + */ + @JsonProperty(value = "requiresPreprocessing") + private Boolean requiresPreprocessing; + + /** + * Get dictionary object for custom filters. + * + * @return the properties value + */ + public Map properties() { + return this.properties; + } + + /** + * Set dictionary object for custom filters. + * + * @param properties the properties value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get identifier of the correlation. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set identifier of the correlation. + * + * @param correlationId the correlationId value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get identifier of the message. + * + * @return the messageId value + */ + public String messageId() { + return this.messageId; + } + + /** + * Set identifier of the message. + * + * @param messageId the messageId value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withMessageId(String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Get address to send to. + * + * @return the to value + */ + public String to() { + return this.to; + } + + /** + * Set address to send to. + * + * @param to the to value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withTo(String to) { + this.to = to; + return this; + } + + /** + * Get address of the queue to reply to. + * + * @return the replyTo value + */ + public String replyTo() { + return this.replyTo; + } + + /** + * Set address of the queue to reply to. + * + * @param replyTo the replyTo value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withReplyTo(String replyTo) { + this.replyTo = replyTo; + return this; + } + + /** + * Get application specific label. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set application specific label. + * + * @param label the label value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get session identifier. + * + * @return the sessionId value + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set session identifier. + * + * @param sessionId the sessionId value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get session identifier to reply to. + * + * @return the replyToSessionId value + */ + public String replyToSessionId() { + return this.replyToSessionId; + } + + /** + * Set session identifier to reply to. + * + * @param replyToSessionId the replyToSessionId value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withReplyToSessionId(String replyToSessionId) { + this.replyToSessionId = replyToSessionId; + return this; + } + + /** + * Get content type of the message. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set content type of the message. + * + * @param contentType the contentType value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set value that indicates whether the rule action requires preprocessing. + * + * @param requiresPreprocessing the requiresPreprocessing value to set + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withRequiresPreprocessing(Boolean requiresPreprocessing) { + this.requiresPreprocessing = requiresPreprocessing; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Destination.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Destination.java new file mode 100644 index 000000000000..ceffc7a5f2f4 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Destination.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Capture storage details for capture description. + */ +@JsonFlatten +public class Destination { + /** + * Name for capture destination. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource id of the storage account to be used to create the blobs. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /** + * Blob container Name. + */ + @JsonProperty(value = "properties.blobContainer") + private String blobContainer; + + /** + * Blob naming convention for archive, e.g. + * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. + * Here all the parameters (Namespace,EventHub .. etc) are mandatory + * irrespective of order. + */ + @JsonProperty(value = "properties.archiveNameFormat") + private String archiveNameFormat; + + /** + * Get name for capture destination. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name for capture destination. + * + * @param name the name value to set + * @return the Destination object itself. + */ + public Destination withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource id of the storage account to be used to create the blobs. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set resource id of the storage account to be used to create the blobs. + * + * @param storageAccountResourceId the storageAccountResourceId value to set + * @return the Destination object itself. + */ + public Destination withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get blob container Name. + * + * @return the blobContainer value + */ + public String blobContainer() { + return this.blobContainer; + } + + /** + * Set blob container Name. + * + * @param blobContainer the blobContainer value to set + * @return the Destination object itself. + */ + public Destination withBlobContainer(String blobContainer) { + this.blobContainer = blobContainer; + return this; + } + + /** + * Get blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order. + * + * @return the archiveNameFormat value + */ + public String archiveNameFormat() { + return this.archiveNameFormat; + } + + /** + * Set blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order. + * + * @param archiveNameFormat the archiveNameFormat value to set + * @return the Destination object itself. + */ + public Destination withArchiveNameFormat(String archiveNameFormat) { + this.archiveNameFormat = archiveNameFormat; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigNamespaceSBAuthorizationRule.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigNamespaceSBAuthorizationRule.java new file mode 100644 index 000000000000..b6dbe55b43e3 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigNamespaceSBAuthorizationRule.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBAuthorizationRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import java.util.List; + +/** + * Type representing DisasterRecoveryConfigNamespaceSBAuthorizationRule. + */ +public interface DisasterRecoveryConfigNamespaceSBAuthorizationRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigs.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigs.java new file mode 100644 index 000000000000..44aac1e67d5a --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/DisasterRecoveryConfigs.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.DisasterRecoveryConfigsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigNamespaceSBAuthorizationRule; + +/** + * Type representing DisasterRecoveryConfigs. + */ +public interface DisasterRecoveryConfigs extends SupportsCreating, HasInner { + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityMethodAsync(String resourceGroupName, String namespaceName, String name); + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable breakPairingAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable failOverAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias); + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EncodingCaptureDescription.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EncodingCaptureDescription.java new file mode 100644 index 000000000000..70a07e934a10 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EncodingCaptureDescription.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncodingCaptureDescription. + */ +public enum EncodingCaptureDescription { + /** Enum value Avro. */ + AVRO("Avro"), + + /** Enum value AvroDeflate. */ + AVRO_DEFLATE("AvroDeflate"); + + /** The actual serialized value for a EncodingCaptureDescription instance. */ + private String value; + + EncodingCaptureDescription(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncodingCaptureDescription instance. + * + * @param value the serialized value to parse. + * @return the parsed EncodingCaptureDescription object, or null if unable to parse. + */ + @JsonCreator + public static EncodingCaptureDescription fromString(String value) { + EncodingCaptureDescription[] items = EncodingCaptureDescription.values(); + for (EncodingCaptureDescription item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Encryption.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Encryption.java new file mode 100644 index 000000000000..afa679125297 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Encryption.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure Encryption. + */ +public class Encryption { + /** + * Properties of KeyVault. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Enumerates the possible value of keySource for Encryption. Possible + * values include: 'Microsoft.KeyVault'. + */ + @JsonProperty(value = "keySource") + private KeySource keySource; + + /** + * Get properties of KeyVault. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set properties of KeyVault. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get enumerates the possible value of keySource for Encryption. Possible values include: 'Microsoft.KeyVault'. + * + * @return the keySource value + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set enumerates the possible value of keySource for Encryption. Possible values include: 'Microsoft.KeyVault'. + * + * @param keySource the keySource value to set + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EndPointProvisioningState.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EndPointProvisioningState.java new file mode 100644 index 000000000000..131b6cdf51d5 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EndPointProvisioningState.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.servicebus.v2018_01_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndPointProvisioningState. + */ +public final class EndPointProvisioningState extends ExpandableStringEnum { + /** Static value Creating for EndPointProvisioningState. */ + public static final EndPointProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for EndPointProvisioningState. */ + public static final EndPointProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for EndPointProvisioningState. */ + public static final EndPointProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for EndPointProvisioningState. */ + public static final EndPointProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for EndPointProvisioningState. */ + public static final EndPointProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for EndPointProvisioningState. */ + public static final EndPointProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a EndPointProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding EndPointProvisioningState + */ + @JsonCreator + public static EndPointProvisioningState fromString(String name) { + return fromString(name, EndPointProvisioningState.class); + } + + /** + * @return known EndPointProvisioningState values + */ + public static Collection values() { + return values(EndPointProvisioningState.class); + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EntityStatus.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EntityStatus.java new file mode 100644 index 000000000000..cd644fc84bd2 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EntityStatus.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EntityStatus. + */ +public enum EntityStatus { + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Restoring. */ + RESTORING("Restoring"), + + /** Enum value SendDisabled. */ + SEND_DISABLED("SendDisabled"), + + /** Enum value ReceiveDisabled. */ + RECEIVE_DISABLED("ReceiveDisabled"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Renaming. */ + RENAMING("Renaming"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a EntityStatus instance. */ + private String value; + + EntityStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EntityStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed EntityStatus object, or null if unable to parse. + */ + @JsonCreator + public static EntityStatus fromString(String value) { + EntityStatus[] items = EntityStatus.values(); + for (EntityStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorAdditionalInfo.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..a11eda407e67 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorAdditionalInfo.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponse.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponse.java index b368e81e0d1c..a754f4364205 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponse.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponse.java @@ -11,59 +11,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Error response indicates ServiceBus service is not able to process the - * incoming request. The reason is provided in the error message. + * The resource management error response. */ public class ErrorResponse { /** - * Error code. + * The error object. */ - @JsonProperty(value = "code") - private String code; + @JsonProperty(value = "error") + private ErrorResponseError error; /** - * Error message indicating why the operation failed. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get error code. - * - * @return the code value - */ - public String code() { - return this.code; - } - - /** - * Set error code. - * - * @param code the code value to set - * @return the ErrorResponse object itself. - */ - public ErrorResponse withCode(String code) { - this.code = code; - return this; - } - - /** - * Get error message indicating why the operation failed. + * Get the error object. * - * @return the message value + * @return the error value */ - public String message() { - return this.message; + public ErrorResponseError error() { + return this.error; } /** - * Set error message indicating why the operation failed. + * Set the error object. * - * @param message the message value to set + * @param error the error value to set * @return the ErrorResponse object itself. */ - public ErrorResponse withMessage(String message) { - this.message = message; + public ErrorResponse withError(ErrorResponseError error) { + this.error = error; return this; } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponseError.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponseError.java new file mode 100644 index 000000000000..e346a8265fa7 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ErrorResponseError.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.servicebus.v2018_01_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponseError { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EventHubs.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EventHubs.java new file mode 100644 index 000000000000..e4a3d36c9651 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/EventHubs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.EventHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EventHubs. + */ +public interface EventHubs extends HasInner { + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Eventhub.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Eventhub.java new file mode 100644 index 000000000000..5a76fd732906 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Eventhub.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.EventhubInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Eventhub. + */ +public interface Eventhub extends HasInner, HasManager { + /** + * @return the captureDescription value. + */ + CaptureDescription captureDescription(); + + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the messageRetentionInDays value. + */ + Long messageRetentionInDays(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partitionCount value. + */ + Long partitionCount(); + + /** + * @return the partitionIds value. + */ + List partitionIds(); + + /** + * @return the status value. + */ + EntityStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/FilterType.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/FilterType.java new file mode 100644 index 000000000000..1ab5417f0028 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/FilterType.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FilterType. + */ +public enum FilterType { + /** Enum value SqlFilter. */ + SQL_FILTER("SqlFilter"), + + /** Enum value CorrelationFilter. */ + CORRELATION_FILTER("CorrelationFilter"); + + /** The actual serialized value for a FilterType instance. */ + private String value; + + FilterType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FilterType instance. + * + * @param value the serialized value to parse. + * @return the parsed FilterType object, or null if unable to parse. + */ + @JsonCreator + public static FilterType fromString(String value) { + FilterType[] items = FilterType.values(); + for (FilterType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Identity.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Identity.java new file mode 100644 index 000000000000..cda8a23e29ca --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Identity.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure Identity for Bring your Own Keys. + */ +public class Identity { + /** + * ObjectId from the KeyVault. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * TenantId from the KeyVault. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Enumerates the possible value Identity type, which currently supports + * only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private IdentityType type; + + /** + * Get objectId from the KeyVault. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set objectId from the KeyVault. + * + * @param principalId the principalId value to set + * @return the Identity object itself. + */ + public Identity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get tenantId from the KeyVault. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set tenantId from the KeyVault. + * + * @param tenantId the tenantId value to set + * @return the Identity object itself. + */ + public Identity withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/IdentityType.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/IdentityType.java new file mode 100644 index 000000000000..c43e3c89ffc1 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/IdentityType.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IdentityType. + */ +public enum IdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a IdentityType instance. */ + private String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeySource.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeySource.java new file mode 100644 index 000000000000..a24de174ccc8 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeySource.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeySource. + */ +public enum KeySource { + /** Enum value Microsoft.KeyVault. */ + MICROSOFT_KEY_VAULT("Microsoft.KeyVault"); + + /** The actual serialized value for a KeySource instance. */ + private String value; + + KeySource(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeySource instance. + * + * @param value the serialized value to parse. + * @return the parsed KeySource object, or null if unable to parse. + */ + @JsonCreator + public static KeySource fromString(String value) { + KeySource[] items = KeySource.values(); + for (KeySource item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyType.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyType.java new file mode 100644 index 000000000000..77ce99c5b63c --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyType.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyType. + */ +public enum KeyType { + /** Enum value PrimaryKey. */ + PRIMARY_KEY("PrimaryKey"), + + /** Enum value SecondaryKey. */ + SECONDARY_KEY("SecondaryKey"); + + /** The actual serialized value for a KeyType instance. */ + private String value; + + KeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyType object, or null if unable to parse. + */ + @JsonCreator + public static KeyType fromString(String value) { + KeyType[] items = KeyType.values(); + for (KeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyVaultProperties.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyVaultProperties.java new file mode 100644 index 000000000000..0f85cc59ad88 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/KeyVaultProperties.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure keyVault Properties. + */ +public class KeyVaultProperties { + /** + * Name of the Key from KeyVault. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Uri of KeyVault. + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /** + * Get name of the Key from KeyVault. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set name of the Key from KeyVault. + * + * @param keyName the keyName value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get uri of KeyVault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MessageCountDetails.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MessageCountDetails.java new file mode 100644 index 000000000000..49d235a86c8d --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MessageCountDetails.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Message Count Details. + */ +public class MessageCountDetails { + /** + * Number of active messages in the queue, topic, or subscription. + */ + @JsonProperty(value = "activeMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long activeMessageCount; + + /** + * Number of messages that are dead lettered. + */ + @JsonProperty(value = "deadLetterMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long deadLetterMessageCount; + + /** + * Number of scheduled messages. + */ + @JsonProperty(value = "scheduledMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledMessageCount; + + /** + * Number of messages transferred to another queue, topic, or subscription. + */ + @JsonProperty(value = "transferMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transferMessageCount; + + /** + * Number of messages transferred into dead letters. + */ + @JsonProperty(value = "transferDeadLetterMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transferDeadLetterMessageCount; + + /** + * Get number of active messages in the queue, topic, or subscription. + * + * @return the activeMessageCount value + */ + public Long activeMessageCount() { + return this.activeMessageCount; + } + + /** + * Get number of messages that are dead lettered. + * + * @return the deadLetterMessageCount value + */ + public Long deadLetterMessageCount() { + return this.deadLetterMessageCount; + } + + /** + * Get number of scheduled messages. + * + * @return the scheduledMessageCount value + */ + public Long scheduledMessageCount() { + return this.scheduledMessageCount; + } + + /** + * Get number of messages transferred to another queue, topic, or subscription. + * + * @return the transferMessageCount value + */ + public Long transferMessageCount() { + return this.transferMessageCount; + } + + /** + * Get number of messages transferred into dead letters. + * + * @return the transferDeadLetterMessageCount value + */ + public Long transferDeadLetterMessageCount() { + return this.transferDeadLetterMessageCount; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigProperties.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigProperties.java new file mode 100644 index 000000000000..9daf777ff9f8 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigProperties.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.MigrationConfigPropertiesInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; + +/** + * Type representing MigrationConfigProperties. + */ +public interface MigrationConfigProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the migrationState value. + */ + String migrationState(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * @return the postMigrationName value. + */ + String postMigrationName(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the targetNamespace value. + */ + String targetNamespace(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the MigrationConfigProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithPostMigrationName, DefinitionStages.WithTargetNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of MigrationConfigProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MigrationConfigProperties definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the migrationconfigproperties definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithPostMigrationName withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the migrationconfigproperties definition allowing to specify PostMigrationName. + */ + interface WithPostMigrationName { + /** + * Specifies postMigrationName. + * @param postMigrationName Name to access Standard Namespace after migration + * @return the next definition stage + */ + WithTargetNamespace withPostMigrationName(String postMigrationName); + } + + /** + * The stage of the migrationconfigproperties definition allowing to specify TargetNamespace. + */ + interface WithTargetNamespace { + /** + * Specifies targetNamespace. + * @param targetNamespace Existing premium Namespace ARM Id name which has no entities, will be used for migration + * @return the next definition stage + */ + WithCreate withTargetNamespace(String targetNamespace); + } + + /** + * 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 MigrationConfigProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of MigrationConfigProperties update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigs.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigs.java new file mode 100644 index 000000000000..c3323a6655b6 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/MigrationConfigs.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.MigrationConfigsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MigrationConfigs. + */ +public interface MigrationConfigs extends SupportsCreating, HasInner { + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable completeMigrationAsync(String resourceGroupName, String namespaceName); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable revertAsync(String resourceGroupName, String namespaceName); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName); + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NameSpaceType.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NameSpaceType.java new file mode 100644 index 000000000000..e84d86f7b5e5 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NameSpaceType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NameSpaceType. + */ +public enum NameSpaceType { + /** Enum value Messaging. */ + MESSAGING("Messaging"), + + /** Enum value NotificationHub. */ + NOTIFICATION_HUB("NotificationHub"), + + /** Enum value Mixed. */ + MIXED("Mixed"), + + /** Enum value EventHub. */ + EVENT_HUB("EventHub"), + + /** Enum value Relay. */ + RELAY("Relay"); + + /** The actual serialized value for a NameSpaceType instance. */ + private String value; + + NameSpaceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameSpaceType instance. + * + * @param value the serialized value to parse. + * @return the parsed NameSpaceType object, or null if unable to parse. + */ + @JsonCreator + public static NameSpaceType fromString(String value) { + NameSpaceType[] items = NameSpaceType.values(); + for (NameSpaceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NamespaceSBAuthorizationRule.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NamespaceSBAuthorizationRule.java new file mode 100644 index 000000000000..870781e0d262 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NamespaceSBAuthorizationRule.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBAuthorizationRuleInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import java.util.List; + +/** + * Type representing NamespaceSBAuthorizationRule. + */ +public interface NamespaceSBAuthorizationRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceSBAuthorizationRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithRights, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceSBAuthorizationRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceSBAuthorizationRule definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespacesbauthorizationrule definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithRights withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespacesbauthorizationrule definition allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next definition stage + */ + WithCreate withRights(List rights); + } + + /** + * 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 NamespaceSBAuthorizationRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithRights { + } + + /** + * Grouping of NamespaceSBAuthorizationRule update stages. + */ + interface UpdateStages { + /** + * The stage of the namespacesbauthorizationrule update allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next update stage + */ + Update withRights(List rights); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Namespaces.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Namespaces.java index 2e4b5553bfad..1b4d2ce062e3 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Namespaces.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Namespaces.java @@ -15,12 +15,13 @@ import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.NamespacesInner; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.IpFilterRule; -import rx.Completable; -import com.microsoft.azure.management.servicebus.v2018_01_01_preview.VirtualNetworkRule; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.NetworkRuleSetInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.VirtualNetworkRule; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.NamespaceSBAuthorizationRule; /** * Type representing Namespaces. @@ -40,6 +41,33 @@ public interface Namespaces extends SupportsCreating checkNameAvailabilityMethodAsync(String name); + /** * Gets an IpFilterRule for a Namespace by rule name. * @@ -72,6 +100,27 @@ public interface Namespaces extends SupportsCreating createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); + /** * Gets an VirtualNetworkRule for a Namespace by rule name. * @@ -105,24 +154,58 @@ public interface Namespaces extends SupportsCreating createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Gets NetworkRuleSet for a Namespace. + * Gets the authorization rules for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters); } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NetworkRuleSet.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NetworkRuleSet.java index 846abd461b7f..631bad34ce10 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NetworkRuleSet.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/NetworkRuleSet.java @@ -38,6 +38,11 @@ public interface NetworkRuleSet extends HasInner, HasManage */ String name(); + /** + * @return the trustedServiceAccessEnabled value. + */ + Boolean trustedServiceAccessEnabled(); + /** * @return the type value. */ diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegion.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegion.java new file mode 100644 index 000000000000..2a26d217fe41 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegion.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.servicebus.v2018_01_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.resources.models.HasManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PremiumMessagingRegionInner; + +/** + * Type representing PremiumMessagingRegion. + */ +public interface PremiumMessagingRegion extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the properties value. + */ + PremiumMessagingRegionProperties properties(); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegionProperties.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegionProperties.java new file mode 100644 index 000000000000..0825d18e635f --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegionProperties.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PremiumMessagingRegionProperties model. + */ +public class PremiumMessagingRegionProperties { + /** + * Region code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Full name of the region. + */ + @JsonProperty(value = "fullName", access = JsonProperty.Access.WRITE_ONLY) + private String fullName; + + /** + * Get region code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get full name of the region. + * + * @return the fullName value + */ + public String fullName() { + return this.fullName; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegions.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegions.java new file mode 100644 index 000000000000..933e1fe982c7 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PremiumMessagingRegions.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PremiumMessagingRegionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PremiumMessagingRegions. + */ +public interface PremiumMessagingRegions extends SupportsListing, HasInner { +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpoint.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpoint.java new file mode 100644 index 000000000000..4df9f83b45d6 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpoint.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * PrivateEndpoint information. + */ +public class PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ARM identifier for Private Endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ARM identifier for Private Endpoint. + * + * @param id the id value to set + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnection.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnection.java new file mode 100644 index 000000000000..bd1bd1f8637e --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnection.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PrivateEndpointConnectionInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + ConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + EndPointProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the privateendpointconnection definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The Private Endpoint resource for this Connection + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Details about the state of the connection + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(EndPointProvisioningState provisioningState); + } + + /** + * 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.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The Private Endpoint resource for this Connection + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Details about the state of the connection + * @return the next update stage + */ + Update withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(EndPointProvisioningState provisioningState); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnections.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnections.java new file mode 100644 index 000000000000..0eac1da9cd98 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateEndpointConnections.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkConnectionStatus.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkConnectionStatus.java new file mode 100644 index 000000000000..96cffa3ade64 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkConnectionStatus.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.servicebus.v2018_01_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateLinkConnectionStatus. + */ +public final class PrivateLinkConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateLinkConnectionStatus. */ + public static final PrivateLinkConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateLinkConnectionStatus. */ + public static final PrivateLinkConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateLinkConnectionStatus. */ + public static final PrivateLinkConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateLinkConnectionStatus. */ + public static final PrivateLinkConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateLinkConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateLinkConnectionStatus + */ + @JsonCreator + public static PrivateLinkConnectionStatus fromString(String name) { + return fromString(name, PrivateLinkConnectionStatus.class); + } + + /** + * @return known PrivateLinkConnectionStatus values + */ + public static Collection values() { + return values(PrivateLinkConnectionStatus.class); + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResources.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResources.java new file mode 100644 index 000000000000..c1bad7ee4670 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResources.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResourcesListResult.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResourcesListResult.java new file mode 100644 index 000000000000..34bd79d84e8a --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/PrivateLinkResourcesListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PrivateLinkResourcesListResultInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.PrivateLinkResourceInner; +import java.util.List; + +/** + * Type representing PrivateLinkResourcesListResult. + */ +public interface PrivateLinkResourcesListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ProvisioningStateDR.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ProvisioningStateDR.java new file mode 100644 index 000000000000..2480cb6bf96d --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/ProvisioningStateDR.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningStateDR. + */ +public enum ProvisioningStateDR { + /** Enum value Accepted. */ + ACCEPTED("Accepted"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a ProvisioningStateDR instance. */ + private String value; + + ProvisioningStateDR(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningStateDR instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningStateDR object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningStateDR fromString(String value) { + ProvisioningStateDR[] items = ProvisioningStateDR.values(); + for (ProvisioningStateDR item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/QueueNamespaceSBAuthorizationRule.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/QueueNamespaceSBAuthorizationRule.java new file mode 100644 index 000000000000..2356b288afa6 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/QueueNamespaceSBAuthorizationRule.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBAuthorizationRuleInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import java.util.List; + +/** + * Type representing QueueNamespaceSBAuthorizationRule. + */ +public interface QueueNamespaceSBAuthorizationRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the QueueNamespaceSBAuthorizationRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithQueue, DefinitionStages.WithRights, DefinitionStages.WithCreate { + } + + /** + * Grouping of QueueNamespaceSBAuthorizationRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a QueueNamespaceSBAuthorizationRule definition. + */ + interface Blank extends WithQueue { + } + + /** + * The stage of the queuenamespacesbauthorizationrule definition allowing to specify Queue. + */ + interface WithQueue { + /** + * Specifies resourceGroupName, namespaceName, queueName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @param queueName The queue name + * @return the next definition stage + */ + WithRights withExistingQueue(String resourceGroupName, String namespaceName, String queueName); + } + + /** + * The stage of the queuenamespacesbauthorizationrule definition allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next definition stage + */ + WithCreate withRights(List rights); + } + + /** + * 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 QueueNamespaceSBAuthorizationRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithRights { + } + + /** + * Grouping of QueueNamespaceSBAuthorizationRule update stages. + */ + interface UpdateStages { + /** + * The stage of the queuenamespacesbauthorizationrule update allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next update stage + */ + Update withRights(List rights); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Queues.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Queues.java new file mode 100644 index 000000000000..582f742955bd --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Queues.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.QueuesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.QueueNamespaceSBAuthorizationRule; + +/** + * Type representing Queues. + */ +public interface Queues extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + QueueNamespaceSBAuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String queueName); + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String queueName); + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String queueName); + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RegenerateAccessKeyParameters.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RegenerateAccessKeyParameters.java new file mode 100644 index 000000000000..3bd812083123 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RegenerateAccessKeyParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Regenerate Authorization Rule operation, + * specifies which key needs to be reset. + */ +public class RegenerateAccessKeyParameters { + /** + * The access key to regenerate. Possible values include: 'PrimaryKey', + * 'SecondaryKey'. + */ + @JsonProperty(value = "keyType", required = true) + private KeyType keyType; + + /** + * Optional, if the key value provided, is reset for KeyType value or + * autogenerate Key value set for keyType. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @return the keyType value + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @param keyType the keyType value to set + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get optional, if the key value provided, is reset for KeyType value or autogenerate Key value set for keyType. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set optional, if the key value provided, is reset for KeyType value or autogenerate Key value set for keyType. + * + * @param key the key value to set + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Regions.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Regions.java new file mode 100644 index 000000000000..8151a59f90f4 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Regions.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.servicebus.v2018_01_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.RegionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Regions. + */ +public interface Regions extends HasInner { + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySkuAsync(final String sku); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RoleDisasterRecovery.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RoleDisasterRecovery.java new file mode 100644 index 000000000000..a3cf7740fa9b --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/RoleDisasterRecovery.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RoleDisasterRecovery. + */ +public enum RoleDisasterRecovery { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value PrimaryNotReplicating. */ + PRIMARY_NOT_REPLICATING("PrimaryNotReplicating"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a RoleDisasterRecovery instance. */ + private String value; + + RoleDisasterRecovery(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RoleDisasterRecovery instance. + * + * @param value the serialized value to parse. + * @return the parsed RoleDisasterRecovery object, or null if unable to parse. + */ + @JsonCreator + public static RoleDisasterRecovery fromString(String value) { + RoleDisasterRecovery[] items = RoleDisasterRecovery.values(); + for (RoleDisasterRecovery item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rule.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rule.java new file mode 100644 index 000000000000..1872f401a88a --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rule.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.RuleInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; + +/** + * Type representing Rule. + */ +public interface Rule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the action value. + */ + Action action(); + + /** + * @return the correlationFilter value. + */ + CorrelationFilter correlationFilter(); + + /** + * @return the filterType value. + */ + FilterType filterType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sqlFilter value. + */ + SqlFilter sqlFilter(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Rule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSubscription, DefinitionStages.WithCreate { + } + + /** + * Grouping of Rule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Rule definition. + */ + interface Blank extends WithSubscription { + } + + /** + * The stage of the rule definition allowing to specify Subscription. + */ + interface WithSubscription { + /** + * Specifies resourceGroupName, namespaceName, topicName, subscriptionName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @param topicName The topic name + * @param subscriptionName The subscription name + * @return the next definition stage + */ + WithCreate withExistingSubscription(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + } + + /** + * The stage of the rule definition allowing to specify Action. + */ + interface WithAction { + /** + * Specifies action. + * @param action Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression + * @return the next definition stage + */ + WithCreate withAction(Action action); + } + + /** + * The stage of the rule definition allowing to specify CorrelationFilter. + */ + interface WithCorrelationFilter { + /** + * Specifies correlationFilter. + * @param correlationFilter Properties of correlationFilter + * @return the next definition stage + */ + WithCreate withCorrelationFilter(CorrelationFilter correlationFilter); + } + + /** + * The stage of the rule definition allowing to specify FilterType. + */ + interface WithFilterType { + /** + * Specifies filterType. + * @param filterType Filter type that is evaluated against a BrokeredMessage. Possible values include: 'SqlFilter', 'CorrelationFilter' + * @return the next definition stage + */ + WithCreate withFilterType(FilterType filterType); + } + + /** + * The stage of the rule definition allowing to specify SqlFilter. + */ + interface WithSqlFilter { + /** + * Specifies sqlFilter. + * @param sqlFilter Properties of sqlFilter + * @return the next definition stage + */ + WithCreate withSqlFilter(SqlFilter sqlFilter); + } + + /** + * 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.WithAction, DefinitionStages.WithCorrelationFilter, DefinitionStages.WithFilterType, DefinitionStages.WithSqlFilter { + } + } + /** + * The template for a Rule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAction, UpdateStages.WithCorrelationFilter, UpdateStages.WithFilterType, UpdateStages.WithSqlFilter { + } + + /** + * Grouping of Rule update stages. + */ + interface UpdateStages { + /** + * The stage of the rule update allowing to specify Action. + */ + interface WithAction { + /** + * Specifies action. + * @param action Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression + * @return the next update stage + */ + Update withAction(Action action); + } + + /** + * The stage of the rule update allowing to specify CorrelationFilter. + */ + interface WithCorrelationFilter { + /** + * Specifies correlationFilter. + * @param correlationFilter Properties of correlationFilter + * @return the next update stage + */ + Update withCorrelationFilter(CorrelationFilter correlationFilter); + } + + /** + * The stage of the rule update allowing to specify FilterType. + */ + interface WithFilterType { + /** + * Specifies filterType. + * @param filterType Filter type that is evaluated against a BrokeredMessage. Possible values include: 'SqlFilter', 'CorrelationFilter' + * @return the next update stage + */ + Update withFilterType(FilterType filterType); + } + + /** + * The stage of the rule update allowing to specify SqlFilter. + */ + interface WithSqlFilter { + /** + * Specifies sqlFilter. + * @param sqlFilter Properties of sqlFilter + * @return the next update stage + */ + Update withSqlFilter(SqlFilter sqlFilter); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rules.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rules.java new file mode 100644 index 000000000000..3cfc27500377 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Rules.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.RulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Rules. + */ +public interface Rules extends SupportsCreating, HasInner { + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySubscriptionsAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName); + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespace.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespace.java index f4715c499bd3..1cd00f1c799d 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespace.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespace.java @@ -30,6 +30,16 @@ public interface SBNamespace extends HasInner, Resource, Group */ DateTime createdAt(); + /** + * @return the encryption value. + */ + Encryption encryption(); + + /** + * @return the identity value. + */ + Identity identity(); + /** * @return the metricId value. */ @@ -82,6 +92,30 @@ interface Blank extends GroupableResourceCore.DefinitionWithRegion { interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { } + /** + * The stage of the sbnamespace definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Properties of BYOK Encryption description + * @return the next definition stage + */ + WithCreate withEncryption(Encryption encryption); + } + + /** + * The stage of the sbnamespace definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Properties of BYOK Identity description + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + /** * The stage of the sbnamespace definition allowing to specify Sku. */ @@ -111,19 +145,43 @@ interface WithZoneRedundant { * 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.WithSku, DefinitionStages.WithZoneRedundant { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithZoneRedundant { } } /** * The template for a SBNamespace update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku, UpdateStages.WithZoneRedundant { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithSku, UpdateStages.WithZoneRedundant { } /** * Grouping of SBNamespace update stages. */ interface UpdateStages { + /** + * The stage of the sbnamespace update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Properties of BYOK Encryption description + * @return the next update stage + */ + Update withEncryption(Encryption encryption); + } + + /** + * The stage of the sbnamespace update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Properties of BYOK Identity description + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + /** * The stage of the sbnamespace update allowing to specify Sku. */ diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceMigrate.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceMigrate.java new file mode 100644 index 000000000000..9714fabb67c5 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceMigrate.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace Migrate Object. + */ +public class SBNamespaceMigrate { + /** + * Type of namespaces. Possible values include: 'Messaging', + * 'NotificationHub', 'Mixed', 'EventHub', 'Relay'. + */ + @JsonProperty(value = "targetNamespaceType", required = true) + private NameSpaceType targetNamespaceType; + + /** + * Get type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay'. + * + * @return the targetNamespaceType value + */ + public NameSpaceType targetNamespaceType() { + return this.targetNamespaceType; + } + + /** + * Set type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay'. + * + * @param targetNamespaceType the targetNamespaceType value to set + * @return the SBNamespaceMigrate object itself. + */ + public SBNamespaceMigrate withTargetNamespaceType(NameSpaceType targetNamespaceType) { + this.targetNamespaceType = targetNamespaceType; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceUpdateParameters.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceUpdateParameters.java index ee0d086c2b40..10fb6765f77c 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceUpdateParameters.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBNamespaceUpdateParameters.java @@ -60,6 +60,18 @@ public class SBNamespaceUpdateParameters extends ResourceNamespacePatch { @JsonProperty(value = "properties.zoneRedundant") private Boolean zoneRedundant; + /** + * Properties of BYOK Encryption description. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Properties of BYOK Identity description. + */ + @JsonProperty(value = "identity") + private Identity identity; + /** * Get properties of SKU. * @@ -145,4 +157,44 @@ public SBNamespaceUpdateParameters withZoneRedundant(Boolean zoneRedundant) { return this; } + /** + * Get properties of BYOK Encryption description. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set properties of BYOK Encryption description. + * + * @param encryption the encryption value to set + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get properties of BYOK Identity description. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set properties of BYOK Identity description. + * + * @param identity the identity value to set + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBQueue.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBQueue.java new file mode 100644 index 000000000000..369fd5336ede --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBQueue.java @@ -0,0 +1,555 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBQueueInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import org.joda.time.DateTime; +import org.joda.time.Period; + +/** + * Type representing SBQueue. + */ +public interface SBQueue extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessedAt value. + */ + DateTime accessedAt(); + + /** + * @return the autoDeleteOnIdle value. + */ + Period autoDeleteOnIdle(); + + /** + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the deadLetteringOnMessageExpiration value. + */ + Boolean deadLetteringOnMessageExpiration(); + + /** + * @return the defaultMessageTimeToLive value. + */ + Period defaultMessageTimeToLive(); + + /** + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Period duplicateDetectionHistoryTimeWindow(); + + /** + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * @return the enableExpress value. + */ + Boolean enableExpress(); + + /** + * @return the enablePartitioning value. + */ + Boolean enablePartitioning(); + + /** + * @return the forwardDeadLetteredMessagesTo value. + */ + String forwardDeadLetteredMessagesTo(); + + /** + * @return the forwardTo value. + */ + String forwardTo(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lockDuration value. + */ + Period lockDuration(); + + /** + * @return the maxDeliveryCount value. + */ + Integer maxDeliveryCount(); + + /** + * @return the maxSizeInMegabytes value. + */ + Integer maxSizeInMegabytes(); + + /** + * @return the messageCount value. + */ + Long messageCount(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiresDuplicateDetection value. + */ + Boolean requiresDuplicateDetection(); + + /** + * @return the requiresSession value. + */ + Boolean requiresSession(); + + /** + * @return the sizeInBytes value. + */ + Long sizeInBytes(); + + /** + * @return the status value. + */ + EntityStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * The entirety of the SBQueue definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of SBQueue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SBQueue definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the sbqueue definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the sbqueue definition allowing to specify AutoDeleteOnIdle. + */ + interface WithAutoDeleteOnIdle { + /** + * Specifies autoDeleteOnIdle. + * @param autoDeleteOnIdle ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes + * @return the next definition stage + */ + WithCreate withAutoDeleteOnIdle(Period autoDeleteOnIdle); + } + + /** + * The stage of the sbqueue definition allowing to specify DeadLetteringOnMessageExpiration. + */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies deadLetteringOnMessageExpiration. + * @param deadLetteringOnMessageExpiration A value that indicates whether this queue has dead letter support when a message expires + * @return the next definition stage + */ + WithCreate withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + + /** + * The stage of the sbqueue definition allowing to specify DefaultMessageTimeToLive. + */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies defaultMessageTimeToLive. + * @param defaultMessageTimeToLive ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself + * @return the next definition stage + */ + WithCreate withDefaultMessageTimeToLive(Period defaultMessageTimeToLive); + } + + /** + * The stage of the sbqueue definition allowing to specify DuplicateDetectionHistoryTimeWindow. + */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies duplicateDetectionHistoryTimeWindow. + * @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes + * @return the next definition stage + */ + WithCreate withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); + } + + /** + * The stage of the sbqueue definition allowing to specify EnableBatchedOperations. + */ + interface WithEnableBatchedOperations { + /** + * Specifies enableBatchedOperations. + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled + * @return the next definition stage + */ + WithCreate withEnableBatchedOperations(Boolean enableBatchedOperations); + } + + /** + * The stage of the sbqueue definition allowing to specify EnableExpress. + */ + interface WithEnableExpress { + /** + * Specifies enableExpress. + * @param enableExpress A value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage + * @return the next definition stage + */ + WithCreate withEnableExpress(Boolean enableExpress); + } + + /** + * The stage of the sbqueue definition allowing to specify EnablePartitioning. + */ + interface WithEnablePartitioning { + /** + * Specifies enablePartitioning. + * @param enablePartitioning A value that indicates whether the queue is to be partitioned across multiple message brokers + * @return the next definition stage + */ + WithCreate withEnablePartitioning(Boolean enablePartitioning); + } + + /** + * The stage of the sbqueue definition allowing to specify ForwardDeadLetteredMessagesTo. + */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies forwardDeadLetteredMessagesTo. + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message + * @return the next definition stage + */ + WithCreate withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + + /** + * The stage of the sbqueue definition allowing to specify ForwardTo. + */ + interface WithForwardTo { + /** + * Specifies forwardTo. + * @param forwardTo Queue/Topic name to forward the messages + * @return the next definition stage + */ + WithCreate withForwardTo(String forwardTo); + } + + /** + * The stage of the sbqueue definition allowing to specify LockDuration. + */ + interface WithLockDuration { + /** + * Specifies lockDuration. + * @param lockDuration ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute + * @return the next definition stage + */ + WithCreate withLockDuration(Period lockDuration); + } + + /** + * The stage of the sbqueue definition allowing to specify MaxDeliveryCount. + */ + interface WithMaxDeliveryCount { + /** + * Specifies maxDeliveryCount. + * @param maxDeliveryCount The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10 + * @return the next definition stage + */ + WithCreate withMaxDeliveryCount(Integer maxDeliveryCount); + } + + /** + * The stage of the sbqueue definition allowing to specify MaxSizeInMegabytes. + */ + interface WithMaxSizeInMegabytes { + /** + * Specifies maxSizeInMegabytes. + * @param maxSizeInMegabytes The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024 + * @return the next definition stage + */ + WithCreate withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + + /** + * The stage of the sbqueue definition allowing to specify RequiresDuplicateDetection. + */ + interface WithRequiresDuplicateDetection { + /** + * Specifies requiresDuplicateDetection. + * @param requiresDuplicateDetection A value indicating if this queue requires duplicate detection + * @return the next definition stage + */ + WithCreate withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + + /** + * The stage of the sbqueue definition allowing to specify RequiresSession. + */ + interface WithRequiresSession { + /** + * Specifies requiresSession. + * @param requiresSession A value that indicates whether the queue supports the concept of sessions + * @return the next definition stage + */ + WithCreate withRequiresSession(Boolean requiresSession); + } + + /** + * The stage of the sbqueue definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next definition stage + */ + WithCreate withStatus(EntityStatus status); + } + + /** + * 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.WithAutoDeleteOnIdle, DefinitionStages.WithDeadLetteringOnMessageExpiration, DefinitionStages.WithDefaultMessageTimeToLive, DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, DefinitionStages.WithEnableBatchedOperations, DefinitionStages.WithEnableExpress, DefinitionStages.WithEnablePartitioning, DefinitionStages.WithForwardDeadLetteredMessagesTo, DefinitionStages.WithForwardTo, DefinitionStages.WithLockDuration, DefinitionStages.WithMaxDeliveryCount, DefinitionStages.WithMaxSizeInMegabytes, DefinitionStages.WithRequiresDuplicateDetection, DefinitionStages.WithRequiresSession, DefinitionStages.WithStatus { + } + } + /** + * The template for a SBQueue update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoDeleteOnIdle, UpdateStages.WithDeadLetteringOnMessageExpiration, UpdateStages.WithDefaultMessageTimeToLive, UpdateStages.WithDuplicateDetectionHistoryTimeWindow, UpdateStages.WithEnableBatchedOperations, UpdateStages.WithEnableExpress, UpdateStages.WithEnablePartitioning, UpdateStages.WithForwardDeadLetteredMessagesTo, UpdateStages.WithForwardTo, UpdateStages.WithLockDuration, UpdateStages.WithMaxDeliveryCount, UpdateStages.WithMaxSizeInMegabytes, UpdateStages.WithRequiresDuplicateDetection, UpdateStages.WithRequiresSession, UpdateStages.WithStatus { + } + + /** + * Grouping of SBQueue update stages. + */ + interface UpdateStages { + /** + * The stage of the sbqueue update allowing to specify AutoDeleteOnIdle. + */ + interface WithAutoDeleteOnIdle { + /** + * Specifies autoDeleteOnIdle. + * @param autoDeleteOnIdle ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes + * @return the next update stage + */ + Update withAutoDeleteOnIdle(Period autoDeleteOnIdle); + } + + /** + * The stage of the sbqueue update allowing to specify DeadLetteringOnMessageExpiration. + */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies deadLetteringOnMessageExpiration. + * @param deadLetteringOnMessageExpiration A value that indicates whether this queue has dead letter support when a message expires + * @return the next update stage + */ + Update withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + + /** + * The stage of the sbqueue update allowing to specify DefaultMessageTimeToLive. + */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies defaultMessageTimeToLive. + * @param defaultMessageTimeToLive ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself + * @return the next update stage + */ + Update withDefaultMessageTimeToLive(Period defaultMessageTimeToLive); + } + + /** + * The stage of the sbqueue update allowing to specify DuplicateDetectionHistoryTimeWindow. + */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies duplicateDetectionHistoryTimeWindow. + * @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes + * @return the next update stage + */ + Update withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); + } + + /** + * The stage of the sbqueue update allowing to specify EnableBatchedOperations. + */ + interface WithEnableBatchedOperations { + /** + * Specifies enableBatchedOperations. + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled + * @return the next update stage + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + + /** + * The stage of the sbqueue update allowing to specify EnableExpress. + */ + interface WithEnableExpress { + /** + * Specifies enableExpress. + * @param enableExpress A value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage + * @return the next update stage + */ + Update withEnableExpress(Boolean enableExpress); + } + + /** + * The stage of the sbqueue update allowing to specify EnablePartitioning. + */ + interface WithEnablePartitioning { + /** + * Specifies enablePartitioning. + * @param enablePartitioning A value that indicates whether the queue is to be partitioned across multiple message brokers + * @return the next update stage + */ + Update withEnablePartitioning(Boolean enablePartitioning); + } + + /** + * The stage of the sbqueue update allowing to specify ForwardDeadLetteredMessagesTo. + */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies forwardDeadLetteredMessagesTo. + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message + * @return the next update stage + */ + Update withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + + /** + * The stage of the sbqueue update allowing to specify ForwardTo. + */ + interface WithForwardTo { + /** + * Specifies forwardTo. + * @param forwardTo Queue/Topic name to forward the messages + * @return the next update stage + */ + Update withForwardTo(String forwardTo); + } + + /** + * The stage of the sbqueue update allowing to specify LockDuration. + */ + interface WithLockDuration { + /** + * Specifies lockDuration. + * @param lockDuration ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute + * @return the next update stage + */ + Update withLockDuration(Period lockDuration); + } + + /** + * The stage of the sbqueue update allowing to specify MaxDeliveryCount. + */ + interface WithMaxDeliveryCount { + /** + * Specifies maxDeliveryCount. + * @param maxDeliveryCount The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10 + * @return the next update stage + */ + Update withMaxDeliveryCount(Integer maxDeliveryCount); + } + + /** + * The stage of the sbqueue update allowing to specify MaxSizeInMegabytes. + */ + interface WithMaxSizeInMegabytes { + /** + * Specifies maxSizeInMegabytes. + * @param maxSizeInMegabytes The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024 + * @return the next update stage + */ + Update withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + + /** + * The stage of the sbqueue update allowing to specify RequiresDuplicateDetection. + */ + interface WithRequiresDuplicateDetection { + /** + * Specifies requiresDuplicateDetection. + * @param requiresDuplicateDetection A value indicating if this queue requires duplicate detection + * @return the next update stage + */ + Update withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + + /** + * The stage of the sbqueue update allowing to specify RequiresSession. + */ + interface WithRequiresSession { + /** + * Specifies requiresSession. + * @param requiresSession A value that indicates whether the queue supports the concept of sessions + * @return the next update stage + */ + Update withRequiresSession(Boolean requiresSession); + } + + /** + * The stage of the sbqueue update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next update stage + */ + Update withStatus(EntityStatus status); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBSubscription.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBSubscription.java new file mode 100644 index 000000000000..16c09864bcc3 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBSubscription.java @@ -0,0 +1,464 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBSubscriptionInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import org.joda.time.DateTime; +import org.joda.time.Period; + +/** + * Type representing SBSubscription. + */ +public interface SBSubscription extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessedAt value. + */ + DateTime accessedAt(); + + /** + * @return the autoDeleteOnIdle value. + */ + Period autoDeleteOnIdle(); + + /** + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the deadLetteringOnFilterEvaluationExceptions value. + */ + Boolean deadLetteringOnFilterEvaluationExceptions(); + + /** + * @return the deadLetteringOnMessageExpiration value. + */ + Boolean deadLetteringOnMessageExpiration(); + + /** + * @return the defaultMessageTimeToLive value. + */ + Period defaultMessageTimeToLive(); + + /** + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Period duplicateDetectionHistoryTimeWindow(); + + /** + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * @return the forwardDeadLetteredMessagesTo value. + */ + String forwardDeadLetteredMessagesTo(); + + /** + * @return the forwardTo value. + */ + String forwardTo(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lockDuration value. + */ + Period lockDuration(); + + /** + * @return the maxDeliveryCount value. + */ + Integer maxDeliveryCount(); + + /** + * @return the messageCount value. + */ + Long messageCount(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiresSession value. + */ + Boolean requiresSession(); + + /** + * @return the status value. + */ + EntityStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * The entirety of the SBSubscription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTopic, DefinitionStages.WithCreate { + } + + /** + * Grouping of SBSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SBSubscription definition. + */ + interface Blank extends WithTopic { + } + + /** + * The stage of the sbsubscription definition allowing to specify Topic. + */ + interface WithTopic { + /** + * Specifies resourceGroupName, namespaceName, topicName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @param topicName The topic name + * @return the next definition stage + */ + WithCreate withExistingTopic(String resourceGroupName, String namespaceName, String topicName); + } + + /** + * The stage of the sbsubscription definition allowing to specify AutoDeleteOnIdle. + */ + interface WithAutoDeleteOnIdle { + /** + * Specifies autoDeleteOnIdle. + * @param autoDeleteOnIdle ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes + * @return the next definition stage + */ + WithCreate withAutoDeleteOnIdle(Period autoDeleteOnIdle); + } + + /** + * The stage of the sbsubscription definition allowing to specify DeadLetteringOnFilterEvaluationExceptions. + */ + interface WithDeadLetteringOnFilterEvaluationExceptions { + /** + * Specifies deadLetteringOnFilterEvaluationExceptions. + * @param deadLetteringOnFilterEvaluationExceptions Value that indicates whether a subscription has dead letter support on filter evaluation exceptions + * @return the next definition stage + */ + WithCreate withDeadLetteringOnFilterEvaluationExceptions(Boolean deadLetteringOnFilterEvaluationExceptions); + } + + /** + * The stage of the sbsubscription definition allowing to specify DeadLetteringOnMessageExpiration. + */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies deadLetteringOnMessageExpiration. + * @param deadLetteringOnMessageExpiration Value that indicates whether a subscription has dead letter support when a message expires + * @return the next definition stage + */ + WithCreate withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + + /** + * The stage of the sbsubscription definition allowing to specify DefaultMessageTimeToLive. + */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies defaultMessageTimeToLive. + * @param defaultMessageTimeToLive ISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself + * @return the next definition stage + */ + WithCreate withDefaultMessageTimeToLive(Period defaultMessageTimeToLive); + } + + /** + * The stage of the sbsubscription definition allowing to specify DuplicateDetectionHistoryTimeWindow. + */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies duplicateDetectionHistoryTimeWindow. + * @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes + * @return the next definition stage + */ + WithCreate withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); + } + + /** + * The stage of the sbsubscription definition allowing to specify EnableBatchedOperations. + */ + interface WithEnableBatchedOperations { + /** + * Specifies enableBatchedOperations. + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled + * @return the next definition stage + */ + WithCreate withEnableBatchedOperations(Boolean enableBatchedOperations); + } + + /** + * The stage of the sbsubscription definition allowing to specify ForwardDeadLetteredMessagesTo. + */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies forwardDeadLetteredMessagesTo. + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message + * @return the next definition stage + */ + WithCreate withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + + /** + * The stage of the sbsubscription definition allowing to specify ForwardTo. + */ + interface WithForwardTo { + /** + * Specifies forwardTo. + * @param forwardTo Queue/Topic name to forward the messages + * @return the next definition stage + */ + WithCreate withForwardTo(String forwardTo); + } + + /** + * The stage of the sbsubscription definition allowing to specify LockDuration. + */ + interface WithLockDuration { + /** + * Specifies lockDuration. + * @param lockDuration ISO 8061 lock duration timespan for the subscription. The default value is 1 minute + * @return the next definition stage + */ + WithCreate withLockDuration(Period lockDuration); + } + + /** + * The stage of the sbsubscription definition allowing to specify MaxDeliveryCount. + */ + interface WithMaxDeliveryCount { + /** + * Specifies maxDeliveryCount. + * @param maxDeliveryCount Number of maximum deliveries + * @return the next definition stage + */ + WithCreate withMaxDeliveryCount(Integer maxDeliveryCount); + } + + /** + * The stage of the sbsubscription definition allowing to specify RequiresSession. + */ + interface WithRequiresSession { + /** + * Specifies requiresSession. + * @param requiresSession Value indicating if a subscription supports the concept of sessions + * @return the next definition stage + */ + WithCreate withRequiresSession(Boolean requiresSession); + } + + /** + * The stage of the sbsubscription definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next definition stage + */ + WithCreate withStatus(EntityStatus status); + } + + /** + * 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.WithAutoDeleteOnIdle, DefinitionStages.WithDeadLetteringOnFilterEvaluationExceptions, DefinitionStages.WithDeadLetteringOnMessageExpiration, DefinitionStages.WithDefaultMessageTimeToLive, DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, DefinitionStages.WithEnableBatchedOperations, DefinitionStages.WithForwardDeadLetteredMessagesTo, DefinitionStages.WithForwardTo, DefinitionStages.WithLockDuration, DefinitionStages.WithMaxDeliveryCount, DefinitionStages.WithRequiresSession, DefinitionStages.WithStatus { + } + } + /** + * The template for a SBSubscription update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoDeleteOnIdle, UpdateStages.WithDeadLetteringOnFilterEvaluationExceptions, UpdateStages.WithDeadLetteringOnMessageExpiration, UpdateStages.WithDefaultMessageTimeToLive, UpdateStages.WithDuplicateDetectionHistoryTimeWindow, UpdateStages.WithEnableBatchedOperations, UpdateStages.WithForwardDeadLetteredMessagesTo, UpdateStages.WithForwardTo, UpdateStages.WithLockDuration, UpdateStages.WithMaxDeliveryCount, UpdateStages.WithRequiresSession, UpdateStages.WithStatus { + } + + /** + * Grouping of SBSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the sbsubscription update allowing to specify AutoDeleteOnIdle. + */ + interface WithAutoDeleteOnIdle { + /** + * Specifies autoDeleteOnIdle. + * @param autoDeleteOnIdle ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes + * @return the next update stage + */ + Update withAutoDeleteOnIdle(Period autoDeleteOnIdle); + } + + /** + * The stage of the sbsubscription update allowing to specify DeadLetteringOnFilterEvaluationExceptions. + */ + interface WithDeadLetteringOnFilterEvaluationExceptions { + /** + * Specifies deadLetteringOnFilterEvaluationExceptions. + * @param deadLetteringOnFilterEvaluationExceptions Value that indicates whether a subscription has dead letter support on filter evaluation exceptions + * @return the next update stage + */ + Update withDeadLetteringOnFilterEvaluationExceptions(Boolean deadLetteringOnFilterEvaluationExceptions); + } + + /** + * The stage of the sbsubscription update allowing to specify DeadLetteringOnMessageExpiration. + */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies deadLetteringOnMessageExpiration. + * @param deadLetteringOnMessageExpiration Value that indicates whether a subscription has dead letter support when a message expires + * @return the next update stage + */ + Update withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + + /** + * The stage of the sbsubscription update allowing to specify DefaultMessageTimeToLive. + */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies defaultMessageTimeToLive. + * @param defaultMessageTimeToLive ISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself + * @return the next update stage + */ + Update withDefaultMessageTimeToLive(Period defaultMessageTimeToLive); + } + + /** + * The stage of the sbsubscription update allowing to specify DuplicateDetectionHistoryTimeWindow. + */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies duplicateDetectionHistoryTimeWindow. + * @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes + * @return the next update stage + */ + Update withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); + } + + /** + * The stage of the sbsubscription update allowing to specify EnableBatchedOperations. + */ + interface WithEnableBatchedOperations { + /** + * Specifies enableBatchedOperations. + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled + * @return the next update stage + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + + /** + * The stage of the sbsubscription update allowing to specify ForwardDeadLetteredMessagesTo. + */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies forwardDeadLetteredMessagesTo. + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message + * @return the next update stage + */ + Update withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + + /** + * The stage of the sbsubscription update allowing to specify ForwardTo. + */ + interface WithForwardTo { + /** + * Specifies forwardTo. + * @param forwardTo Queue/Topic name to forward the messages + * @return the next update stage + */ + Update withForwardTo(String forwardTo); + } + + /** + * The stage of the sbsubscription update allowing to specify LockDuration. + */ + interface WithLockDuration { + /** + * Specifies lockDuration. + * @param lockDuration ISO 8061 lock duration timespan for the subscription. The default value is 1 minute + * @return the next update stage + */ + Update withLockDuration(Period lockDuration); + } + + /** + * The stage of the sbsubscription update allowing to specify MaxDeliveryCount. + */ + interface WithMaxDeliveryCount { + /** + * Specifies maxDeliveryCount. + * @param maxDeliveryCount Number of maximum deliveries + * @return the next update stage + */ + Update withMaxDeliveryCount(Integer maxDeliveryCount); + } + + /** + * The stage of the sbsubscription update allowing to specify RequiresSession. + */ + interface WithRequiresSession { + /** + * Specifies requiresSession. + * @param requiresSession Value indicating if a subscription supports the concept of sessions + * @return the next update stage + */ + Update withRequiresSession(Boolean requiresSession); + } + + /** + * The stage of the sbsubscription update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next update stage + */ + Update withStatus(EntityStatus status); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBTopic.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBTopic.java new file mode 100644 index 000000000000..fdec9db52ae5 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SBTopic.java @@ -0,0 +1,410 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBTopicInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import org.joda.time.DateTime; +import org.joda.time.Period; + +/** + * Type representing SBTopic. + */ +public interface SBTopic extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessedAt value. + */ + DateTime accessedAt(); + + /** + * @return the autoDeleteOnIdle value. + */ + Period autoDeleteOnIdle(); + + /** + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the defaultMessageTimeToLive value. + */ + Period defaultMessageTimeToLive(); + + /** + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Period duplicateDetectionHistoryTimeWindow(); + + /** + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * @return the enableExpress value. + */ + Boolean enableExpress(); + + /** + * @return the enablePartitioning value. + */ + Boolean enablePartitioning(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the maxSizeInMegabytes value. + */ + Integer maxSizeInMegabytes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiresDuplicateDetection value. + */ + Boolean requiresDuplicateDetection(); + + /** + * @return the sizeInBytes value. + */ + Long sizeInBytes(); + + /** + * @return the status value. + */ + EntityStatus status(); + + /** + * @return the subscriptionCount value. + */ + Integer subscriptionCount(); + + /** + * @return the supportOrdering value. + */ + Boolean supportOrdering(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * The entirety of the SBTopic definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of SBTopic definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SBTopic definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the sbtopic definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the sbtopic definition allowing to specify AutoDeleteOnIdle. + */ + interface WithAutoDeleteOnIdle { + /** + * Specifies autoDeleteOnIdle. + * @param autoDeleteOnIdle ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes + * @return the next definition stage + */ + WithCreate withAutoDeleteOnIdle(Period autoDeleteOnIdle); + } + + /** + * The stage of the sbtopic definition allowing to specify DefaultMessageTimeToLive. + */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies defaultMessageTimeToLive. + * @param defaultMessageTimeToLive ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself + * @return the next definition stage + */ + WithCreate withDefaultMessageTimeToLive(Period defaultMessageTimeToLive); + } + + /** + * The stage of the sbtopic definition allowing to specify DuplicateDetectionHistoryTimeWindow. + */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies duplicateDetectionHistoryTimeWindow. + * @param duplicateDetectionHistoryTimeWindow ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes + * @return the next definition stage + */ + WithCreate withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); + } + + /** + * The stage of the sbtopic definition allowing to specify EnableBatchedOperations. + */ + interface WithEnableBatchedOperations { + /** + * Specifies enableBatchedOperations. + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled + * @return the next definition stage + */ + WithCreate withEnableBatchedOperations(Boolean enableBatchedOperations); + } + + /** + * The stage of the sbtopic definition allowing to specify EnableExpress. + */ + interface WithEnableExpress { + /** + * Specifies enableExpress. + * @param enableExpress Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage + * @return the next definition stage + */ + WithCreate withEnableExpress(Boolean enableExpress); + } + + /** + * The stage of the sbtopic definition allowing to specify EnablePartitioning. + */ + interface WithEnablePartitioning { + /** + * Specifies enablePartitioning. + * @param enablePartitioning Value that indicates whether the topic to be partitioned across multiple message brokers is enabled + * @return the next definition stage + */ + WithCreate withEnablePartitioning(Boolean enablePartitioning); + } + + /** + * The stage of the sbtopic definition allowing to specify MaxSizeInMegabytes. + */ + interface WithMaxSizeInMegabytes { + /** + * Specifies maxSizeInMegabytes. + * @param maxSizeInMegabytes Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024 + * @return the next definition stage + */ + WithCreate withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + + /** + * The stage of the sbtopic definition allowing to specify RequiresDuplicateDetection. + */ + interface WithRequiresDuplicateDetection { + /** + * Specifies requiresDuplicateDetection. + * @param requiresDuplicateDetection Value indicating if this topic requires duplicate detection + * @return the next definition stage + */ + WithCreate withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + + /** + * The stage of the sbtopic definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next definition stage + */ + WithCreate withStatus(EntityStatus status); + } + + /** + * The stage of the sbtopic definition allowing to specify SupportOrdering. + */ + interface WithSupportOrdering { + /** + * Specifies supportOrdering. + * @param supportOrdering Value that indicates whether the topic supports ordering + * @return the next definition stage + */ + WithCreate withSupportOrdering(Boolean supportOrdering); + } + + /** + * 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.WithAutoDeleteOnIdle, DefinitionStages.WithDefaultMessageTimeToLive, DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, DefinitionStages.WithEnableBatchedOperations, DefinitionStages.WithEnableExpress, DefinitionStages.WithEnablePartitioning, DefinitionStages.WithMaxSizeInMegabytes, DefinitionStages.WithRequiresDuplicateDetection, DefinitionStages.WithStatus, DefinitionStages.WithSupportOrdering { + } + } + /** + * The template for a SBTopic update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoDeleteOnIdle, UpdateStages.WithDefaultMessageTimeToLive, UpdateStages.WithDuplicateDetectionHistoryTimeWindow, UpdateStages.WithEnableBatchedOperations, UpdateStages.WithEnableExpress, UpdateStages.WithEnablePartitioning, UpdateStages.WithMaxSizeInMegabytes, UpdateStages.WithRequiresDuplicateDetection, UpdateStages.WithStatus, UpdateStages.WithSupportOrdering { + } + + /** + * Grouping of SBTopic update stages. + */ + interface UpdateStages { + /** + * The stage of the sbtopic update allowing to specify AutoDeleteOnIdle. + */ + interface WithAutoDeleteOnIdle { + /** + * Specifies autoDeleteOnIdle. + * @param autoDeleteOnIdle ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes + * @return the next update stage + */ + Update withAutoDeleteOnIdle(Period autoDeleteOnIdle); + } + + /** + * The stage of the sbtopic update allowing to specify DefaultMessageTimeToLive. + */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies defaultMessageTimeToLive. + * @param defaultMessageTimeToLive ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself + * @return the next update stage + */ + Update withDefaultMessageTimeToLive(Period defaultMessageTimeToLive); + } + + /** + * The stage of the sbtopic update allowing to specify DuplicateDetectionHistoryTimeWindow. + */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies duplicateDetectionHistoryTimeWindow. + * @param duplicateDetectionHistoryTimeWindow ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes + * @return the next update stage + */ + Update withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); + } + + /** + * The stage of the sbtopic update allowing to specify EnableBatchedOperations. + */ + interface WithEnableBatchedOperations { + /** + * Specifies enableBatchedOperations. + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled + * @return the next update stage + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + + /** + * The stage of the sbtopic update allowing to specify EnableExpress. + */ + interface WithEnableExpress { + /** + * Specifies enableExpress. + * @param enableExpress Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage + * @return the next update stage + */ + Update withEnableExpress(Boolean enableExpress); + } + + /** + * The stage of the sbtopic update allowing to specify EnablePartitioning. + */ + interface WithEnablePartitioning { + /** + * Specifies enablePartitioning. + * @param enablePartitioning Value that indicates whether the topic to be partitioned across multiple message brokers is enabled + * @return the next update stage + */ + Update withEnablePartitioning(Boolean enablePartitioning); + } + + /** + * The stage of the sbtopic update allowing to specify MaxSizeInMegabytes. + */ + interface WithMaxSizeInMegabytes { + /** + * Specifies maxSizeInMegabytes. + * @param maxSizeInMegabytes Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024 + * @return the next update stage + */ + Update withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + + /** + * The stage of the sbtopic update allowing to specify RequiresDuplicateDetection. + */ + interface WithRequiresDuplicateDetection { + /** + * Specifies requiresDuplicateDetection. + * @param requiresDuplicateDetection Value indicating if this topic requires duplicate detection + * @return the next update stage + */ + Update withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + + /** + * The stage of the sbtopic update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next update stage + */ + Update withStatus(EntityStatus status); + } + + /** + * The stage of the sbtopic update allowing to specify SupportOrdering. + */ + interface WithSupportOrdering { + /** + * Specifies supportOrdering. + * @param supportOrdering Value that indicates whether the topic supports ordering + * @return the next update stage + */ + Update withSupportOrdering(Boolean supportOrdering); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlFilter.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlFilter.java new file mode 100644 index 000000000000..a4f52500826c --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlFilter.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a filter which is a composition of an expression and an action + * that is executed in the pub/sub pipeline. + */ +public class SqlFilter { + /** + * The SQL expression. e.g. MyProperty='ABC'. + */ + @JsonProperty(value = "sqlExpression") + private String sqlExpression; + + /** + * This property is reserved for future use. An integer value showing the + * compatibility level, currently hard-coded to 20. + */ + @JsonProperty(value = "compatibilityLevel") + private Integer compatibilityLevel; + + /** + * Value that indicates whether the rule action requires preprocessing. + */ + @JsonProperty(value = "requiresPreprocessing") + private Boolean requiresPreprocessing; + + /** + * Get the SQL expression. e.g. MyProperty='ABC'. + * + * @return the sqlExpression value + */ + public String sqlExpression() { + return this.sqlExpression; + } + + /** + * Set the SQL expression. e.g. MyProperty='ABC'. + * + * @param sqlExpression the sqlExpression value to set + * @return the SqlFilter object itself. + */ + public SqlFilter withSqlExpression(String sqlExpression) { + this.sqlExpression = sqlExpression; + return this; + } + + /** + * Get this property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. + * + * @return the compatibilityLevel value + */ + public Integer compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set this property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. + * + * @param compatibilityLevel the compatibilityLevel value to set + * @return the SqlFilter object itself. + */ + public SqlFilter withCompatibilityLevel(Integer compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set value that indicates whether the rule action requires preprocessing. + * + * @param requiresPreprocessing the requiresPreprocessing value to set + * @return the SqlFilter object itself. + */ + public SqlFilter withRequiresPreprocessing(Boolean requiresPreprocessing) { + this.requiresPreprocessing = requiresPreprocessing; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlRuleAction.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlRuleAction.java new file mode 100644 index 000000000000..6768bf82c607 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/SqlRuleAction.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + + +/** + * Represents set of actions written in SQL language-based syntax that is + * performed against a ServiceBus.Messaging.BrokeredMessage. + */ +public class SqlRuleAction extends Action { +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Subscriptions.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Subscriptions.java new file mode 100644 index 000000000000..08c2aac5c56e --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Subscriptions.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SubscriptionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Subscriptions. + */ +public interface Subscriptions extends SupportsCreating, HasInner { + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByTopicAsync(final String resourceGroupName, final String namespaceName, final String topicName); + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/TopicNamespaceSBAuthorizationRule.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/TopicNamespaceSBAuthorizationRule.java new file mode 100644 index 000000000000..0787409962c8 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/TopicNamespaceSBAuthorizationRule.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.SBAuthorizationRuleInner; +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.servicebus.v2018_01_01_preview.implementation.ServiceBusManager; +import java.util.List; + +/** + * Type representing TopicNamespaceSBAuthorizationRule. + */ +public interface TopicNamespaceSBAuthorizationRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the TopicNamespaceSBAuthorizationRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTopic, DefinitionStages.WithRights, DefinitionStages.WithCreate { + } + + /** + * Grouping of TopicNamespaceSBAuthorizationRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a TopicNamespaceSBAuthorizationRule definition. + */ + interface Blank extends WithTopic { + } + + /** + * The stage of the topicnamespacesbauthorizationrule definition allowing to specify Topic. + */ + interface WithTopic { + /** + * Specifies resourceGroupName, namespaceName, topicName. + * @param resourceGroupName Name of the Resource group within the Azure subscription + * @param namespaceName The namespace name + * @param topicName The topic name + * @return the next definition stage + */ + WithRights withExistingTopic(String resourceGroupName, String namespaceName, String topicName); + } + + /** + * The stage of the topicnamespacesbauthorizationrule definition allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next definition stage + */ + WithCreate withRights(List rights); + } + + /** + * 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 TopicNamespaceSBAuthorizationRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithRights { + } + + /** + * Grouping of TopicNamespaceSBAuthorizationRule update stages. + */ + interface UpdateStages { + /** + * The stage of the topicnamespacesbauthorizationrule update allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next update stage + */ + Update withRights(List rights); + } + + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Topics.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Topics.java new file mode 100644 index 000000000000..f5cb0da100b4 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/Topics.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.servicebus.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation.TopicsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.TopicNamespaceSBAuthorizationRule; + +/** + * Type representing Topics. + */ +public interface Topics extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + TopicNamespaceSBAuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String topicName); + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String topicName); + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName); + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters); + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/UnavailableReason.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/UnavailableReason.java new file mode 100644 index 000000000000..9747c8e42437 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/UnavailableReason.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.servicebus.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UnavailableReason. + */ +public enum UnavailableReason { + /** Enum value None. */ + NONE("None"), + + /** Enum value InvalidName. */ + INVALID_NAME("InvalidName"), + + /** Enum value SubscriptionIsDisabled. */ + SUBSCRIPTION_IS_DISABLED("SubscriptionIsDisabled"), + + /** Enum value NameInUse. */ + NAME_IN_USE("NameInUse"), + + /** Enum value NameInLockdown. */ + NAME_IN_LOCKDOWN("NameInLockdown"), + + /** Enum value TooManyNamespaceInCurrentSubscription. */ + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION("TooManyNamespaceInCurrentSubscription"); + + /** The actual serialized value for a UnavailableReason instance. */ + private String value; + + UnavailableReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UnavailableReason instance. + * + * @param value the serialized value to parse. + * @return the parsed UnavailableReason object, or null if unable to parse. + */ + @JsonCreator + public static UnavailableReason fromString(String value) { + UnavailableReason[] items = UnavailableReason.values(); + for (UnavailableReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysImpl.java new file mode 100644 index 000000000000..3b49245ac2b6 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysImpl.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.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AccessKeysImpl extends WrapperImpl implements AccessKeys { + private final ServiceBusManager manager; + AccessKeysImpl(AccessKeysInner inner, ServiceBusManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public String aliasPrimaryConnectionString() { + return this.inner().aliasPrimaryConnectionString(); + } + + @Override + public String aliasSecondaryConnectionString() { + return this.inner().aliasSecondaryConnectionString(); + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysInner.java new file mode 100644 index 000000000000..2aa209070e75 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/AccessKeysInner.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.servicebus.v2018_01_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/ServiceBus Connection String. + */ +public class AccessKeysInner { + /** + * Primary connection string of the created namespace authorization rule. + */ + @JsonProperty(value = "primaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String primaryConnectionString; + + /** + * Secondary connection string of the created namespace authorization rule. + */ + @JsonProperty(value = "secondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryConnectionString; + + /** + * Primary connection string of the alias if GEO DR is enabled. + */ + @JsonProperty(value = "aliasPrimaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String aliasPrimaryConnectionString; + + /** + * Secondary connection string of the alias if GEO DR is enabled. + */ + @JsonProperty(value = "aliasSecondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String aliasSecondaryConnectionString; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the authorization rule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * Get primary connection string of the created namespace authorization rule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Get secondary connection string of the created namespace authorization rule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Get primary connection string of the alias if GEO DR is enabled. + * + * @return the aliasPrimaryConnectionString value + */ + public String aliasPrimaryConnectionString() { + return this.aliasPrimaryConnectionString; + } + + /** + * Get secondary connection string of the alias if GEO DR is enabled. + * + * @return the aliasSecondaryConnectionString value + */ + public String aliasSecondaryConnectionString() { + return this.aliasSecondaryConnectionString; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get a string that describes the authorization rule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java new file mode 100644 index 000000000000..fc50fa3333a9 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ArmDisasterRecovery; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ProvisioningStateDR; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RoleDisasterRecovery; + +class ArmDisasterRecoveryImpl extends CreatableUpdatableImpl implements ArmDisasterRecovery, ArmDisasterRecovery.Definition, ArmDisasterRecovery.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String alias; + + ArmDisasterRecoveryImpl(String name, ServiceBusManager manager) { + super(name, new ArmDisasterRecoveryInner()); + this.manager = manager; + // Set resource name + this.alias = name; + // + } + + ArmDisasterRecoveryImpl(ArmDisasterRecoveryInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.alias = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.alias = IdParsingUtils.getValueFromIdByName(inner.id(), "disasterRecoveryConfigs"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.alias, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.alias, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.alias); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternateName() { + return this.inner().alternateName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String partnerNamespace() { + return this.inner().partnerNamespace(); + } + + @Override + public Long pendingReplicationOperationsCount() { + return this.inner().pendingReplicationOperationsCount(); + } + + @Override + public ProvisioningStateDR provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RoleDisasterRecovery role() { + return this.inner().role(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ArmDisasterRecoveryImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public ArmDisasterRecoveryImpl withAlternateName(String alternateName) { + this.inner().withAlternateName(alternateName); + return this; + } + + @Override + public ArmDisasterRecoveryImpl withPartnerNamespace(String partnerNamespace) { + this.inner().withPartnerNamespace(partnerNamespace); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java new file mode 100644 index 000000000000..cb3b58c3414d --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ProvisioningStateDR; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RoleDisasterRecovery; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in List or Get Alias(Disaster Recovery configuration) operation. + */ +@JsonFlatten +public class ArmDisasterRecoveryInner extends ProxyResource { + /** + * Provisioning state of the Alias(Disaster Recovery configuration) - + * possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values + * include: 'Accepted', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateDR provisioningState; + + /** + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "properties.pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long pendingReplicationOperationsCount; + + /** + * ARM Id of the Primary/Secondary eventhub namespace name, which is part + * of GEO DR pairing. + */ + @JsonProperty(value = "properties.partnerNamespace") + private String partnerNamespace; + + /** + * Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + */ + @JsonProperty(value = "properties.alternateName") + private String alternateName; + + /** + * role of namespace in GEO DR - possible values 'Primary' or + * 'PrimaryNotReplicating' or 'Secondary'. Possible values include: + * 'Primary', 'PrimaryNotReplicating', 'Secondary'. + */ + @JsonProperty(value = "properties.role", access = JsonProperty.Access.WRITE_ONLY) + private RoleDisasterRecovery role; + + /** + * Get provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningStateDR provisioningState() { + return this.provisioningState; + } + + /** + * Get number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Get aRM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the partnerNamespace value + */ + public String partnerNamespace() { + return this.partnerNamespace; + } + + /** + * Set aRM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @param partnerNamespace the partnerNamespace value to set + * @return the ArmDisasterRecoveryInner object itself. + */ + public ArmDisasterRecoveryInner withPartnerNamespace(String partnerNamespace) { + this.partnerNamespace = partnerNamespace; + return this; + } + + /** + * Get primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the alternateName value + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @param alternateName the alternateName value to set + * @return the ArmDisasterRecoveryInner object itself. + */ + public ArmDisasterRecoveryInner withAlternateName(String alternateName) { + this.alternateName = alternateName; + return this; + } + + /** + * Get role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary'. + * + * @return the role value + */ + public RoleDisasterRecovery role() { + return this.role; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..a47025ba6c14 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.UnavailableReason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final ServiceBusManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, ServiceBusManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public UnavailableReason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..87410f74c444 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.UnavailableReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a Check Name availability request properties. + */ +public class CheckNameAvailabilityResultInner { + /** + * The detailed info regarding the reason associated with the namespace. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Value indicating namespace is availability, true if the namespace is + * available; otherwise, false. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason for unavailability of a namespace. Possible values include: + * 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', + * 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'. + */ + @JsonProperty(value = "reason") + private UnavailableReason reason; + + /** + * Get the detailed info regarding the reason associated with the namespace. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get value indicating namespace is availability, true if the namespace is available; otherwise, false. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set value indicating namespace is availability, true if the namespace is available; otherwise, false. + * + * @param nameAvailable the nameAvailable value to set + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason for unavailability of a namespace. Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'. + * + * @return the reason value + */ + public UnavailableReason reason() { + return this.reason; + } + + /** + * Set the reason for unavailability of a namespace. Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'. + * + * @param reason the reason value to set + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withReason(UnavailableReason reason) { + this.reason = reason; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl.java new file mode 100644 index 000000000000..eb4724c23ee5 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigNamespaceSBAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; + +class DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl extends IndexableRefreshableWrapperImpl implements DisasterRecoveryConfigNamespaceSBAuthorizationRule { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String alias; + private String authorizationRuleName; + + DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl(SBAuthorizationRuleInner inner, ServiceBusManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.alias = IdParsingUtils.getValueFromIdByName(inner.id(), "disasterRecoveryConfigs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.alias, this.authorizationRuleName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java new file mode 100644 index 000000000000..bed7799c785c --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ArmDisasterRecovery; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigNamespaceSBAuthorizationRule; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessKeys; + +class DisasterRecoveryConfigsImpl extends WrapperImpl implements DisasterRecoveryConfigs { + private final ServiceBusManager manager; + + DisasterRecoveryConfigsImpl(ServiceBusManager manager) { + super(manager.inner().disasterRecoveryConfigs()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public ArmDisasterRecoveryImpl define(String name) { + return wrapModel(name); + } + + private ArmDisasterRecoveryImpl wrapModel(ArmDisasterRecoveryInner inner) { + return new ArmDisasterRecoveryImpl(inner, manager()); + } + + private ArmDisasterRecoveryImpl wrapModel(String name) { + return new ArmDisasterRecoveryImpl(name, this.manager()); + } + + @Override + public Observable checkNameAvailabilityMethodAsync(String resourceGroupName, String namespaceName, String name) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.checkNameAvailabilityMethodAsync(resourceGroupName, namespaceName, name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.breakPairingAsync(resourceGroupName, namespaceName, alias).toCompletable(); + } + + @Override + public Completable failOverAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.failOverAsync(resourceGroupName, namespaceName, alias).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ArmDisasterRecovery call(ArmDisasterRecoveryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, alias) + .flatMap(new Func1>() { + @Override + public Observable call(ArmDisasterRecoveryInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ArmDisasterRecovery)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, alias).toCompletable(); + } + + private DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl wrapDisasterRecoveryConfigNamespaceSBAuthorizationRuleModel(SBAuthorizationRuleInner inner) { + return new DisasterRecoveryConfigNamespaceSBAuthorizationRuleImpl(inner, manager()); + } + + private Observable getSBAuthorizationRuleInnerUsingDisasterRecoveryConfigsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String alias = IdParsingUtils.getValueFromIdByName(id, "disasterRecoveryConfigs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + DisasterRecoveryConfigsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) + .flatMap(new Func1>() { + @Override + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DisasterRecoveryConfigNamespaceSBAuthorizationRule)wrapDisasterRecoveryConfigNamespaceSBAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DisasterRecoveryConfigNamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { + return wrapDisasterRecoveryConfigNamespaceSBAuthorizationRuleModel(inner); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java new file mode 100644 index 000000000000..2751b3aa5300 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java @@ -0,0 +1,1338 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CheckNameAvailability; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 DisasterRecoveryConfigs. + */ +public class DisasterRecoveryConfigsInner { + /** The Retrofit service to perform REST calls. */ + private DisasterRecoveryConfigsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of DisasterRecoveryConfigsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DisasterRecoveryConfigsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(DisasterRecoveryConfigsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DisasterRecoveryConfigs to be + * used by Retrofit to perform actually REST calls. + */ + interface DisasterRecoveryConfigsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs checkNameAvailabilityMethod" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability") + Observable> checkNameAvailabilityMethod(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailability parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Body ArmDisasterRecoveryInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs breakPairing" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing") + Observable> breakPairing(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs failOver" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover") + Observable> failOver(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs 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.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailabilityMethod(String resourceGroupName, String namespaceName, String name) { + return checkNameAvailabilityMethodWithServiceResponseAsync(resourceGroupName, namespaceName, name).toBlocking().single().body(); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @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 checkNameAvailabilityMethodAsync(String resourceGroupName, String namespaceName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityMethodWithServiceResponseAsync(resourceGroupName, namespaceName, name), serviceCallback); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityMethodAsync(String resourceGroupName, String namespaceName, String name) { + return checkNameAvailabilityMethodWithServiceResponseAsync(resourceGroupName, namespaceName, name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityMethodWithServiceResponseAsync(String resourceGroupName, String namespaceName, String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + CheckNameAvailability parameters = new CheckNameAvailability(); + parameters.withName(name); + return service.checkNameAvailabilityMethod(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityMethodDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ArmDisasterRecoveryInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ArmDisasterRecoveryInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ArmDisasterRecoveryInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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)); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArmDisasterRecoveryInner object if successful. + */ + public ArmDisasterRecoveryInner createOrUpdate(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @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 namespaceName, String alias, ArmDisasterRecoveryInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters), serviceCallback); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).map(new Func1, ArmDisasterRecoveryInner>() { + @Override + public ArmDisasterRecoveryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String alias) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration 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 deleteAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String alias) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArmDisasterRecoveryInner object if successful. + */ + public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration 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 getAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String alias) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, ArmDisasterRecoveryInner>() { + @Override + public ArmDisasterRecoveryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void breakPairing(String resourceGroupName, String namespaceName, String alias) { + breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration 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 breakPairingAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { + return breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> breakPairingWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.breakPairing(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = breakPairingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse breakPairingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void failOver(String resourceGroupName, String namespaceName, String alias) { + failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration 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 failOverAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable failOverAsync(String resourceGroupName, String namespaceName, String alias) { + return failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> failOverWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.failOver(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = failOverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse failOverDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String alias) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration 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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, alias) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBAuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String alias) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBAuthorizationRuleInner object if successful. + */ + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule 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 listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback); + } + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ArmDisasterRecoveryInner> 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(); + } + }; + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @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); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @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<ArmDisasterRecoveryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @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<ArmDisasterRecoveryInner> 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)); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for a namespace. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + * @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<SBAuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsImpl.java new file mode 100644 index 000000000000..bf6554662329 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsImpl.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.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EventHubs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Eventhub; + +class EventHubsImpl extends WrapperImpl implements EventHubs { + private final ServiceBusManager manager; + + EventHubsImpl(ServiceBusManager manager) { + super(manager.inner().eventHubs()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + private EventhubImpl wrapModel(EventhubInner inner) { + return new EventhubImpl(inner, manager()); + } + + @Override + public Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + EventHubsInner client = this.inner(); + return client.listByNamespaceAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Eventhub call(EventhubInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsInner.java new file mode 100644 index 000000000000..599c7db0b64a --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventHubsInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EventHubs. + */ +public class EventHubsInner { + /** The Retrofit service to perform REST calls. */ + private EventHubsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of EventHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EventHubsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(EventHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EventHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface EventHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.EventHubs listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs") + Observable> listByNamespace(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.EventHubs listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventhubInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventhubInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventhubInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName) + .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventhubInner> object if successful. + */ + public PagedList listByNamespaceNext(final String nextPageLink) { + ServiceResponse> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @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> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @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<EventhubInner> object + */ + public Observable> listByNamespaceNextAsync(final String nextPageLink) { + return listByNamespaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + * @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<EventhubInner> object + */ + public Observable>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByNamespaceNextSinglePageAsync(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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Event Hubs in a service bus Namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceNextSinglePageAsync(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.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubImpl.java new file mode 100644 index 000000000000..37367d85b2cc --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubImpl.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.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Eventhub; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CaptureDescription; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; + +class EventhubImpl extends WrapperImpl implements Eventhub { + private final ServiceBusManager manager; + + EventhubImpl(EventhubInner inner, ServiceBusManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + + + @Override + public CaptureDescription captureDescription() { + return this.inner().captureDescription(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long messageRetentionInDays() { + return this.inner().messageRetentionInDays(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long partitionCount() { + return this.inner().partitionCount(); + } + + @Override + public List partitionIds() { + return this.inner().partitionIds(); + } + + @Override + public EntityStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubInner.java new file mode 100644 index 000000000000..7dafce873ea2 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/EventhubInner.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CaptureDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in List or Get Event Hub operation. + */ +@JsonFlatten +public class EventhubInner extends ProxyResource { + /** + * Current number of shards on the Event Hub. + */ + @JsonProperty(value = "properties.partitionIds", access = JsonProperty.Access.WRITE_ONLY) + private List partitionIds; + + /** + * Exact time the Event Hub was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdAt; + + /** + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updatedAt; + + /** + * Number of days to retain the events for this Event Hub, value should be + * 1 to 7 days. + */ + @JsonProperty(value = "properties.messageRetentionInDays") + private Long messageRetentionInDays; + + /** + * Number of partitions created for the Event Hub, allowed values are from + * 1 to 32 partitions. + */ + @JsonProperty(value = "properties.partitionCount") + private Long partitionCount; + + /** + * Enumerates the possible values for the status of a Event Hub. Possible + * values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', + * 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + */ + @JsonProperty(value = "properties.status") + private EntityStatus status; + + /** + * Properties of capture description. + */ + @JsonProperty(value = "properties.captureDescription") + private CaptureDescription captureDescription; + + /** + * Get current number of shards on the Event Hub. + * + * @return the partitionIds value + */ + public List partitionIds() { + return this.partitionIds; + } + + /** + * Get exact time the Event Hub was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Get the exact time the message was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get number of days to retain the events for this Event Hub, value should be 1 to 7 days. + * + * @return the messageRetentionInDays value + */ + public Long messageRetentionInDays() { + return this.messageRetentionInDays; + } + + /** + * Set number of days to retain the events for this Event Hub, value should be 1 to 7 days. + * + * @param messageRetentionInDays the messageRetentionInDays value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withMessageRetentionInDays(Long messageRetentionInDays) { + this.messageRetentionInDays = messageRetentionInDays; + return this; + } + + /** + * Get number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + * + * @return the partitionCount value + */ + public Long partitionCount() { + return this.partitionCount; + } + + /** + * Set number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + * + * @param partitionCount the partitionCount value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withPartitionCount(Long partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @return the status value + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @param status the status value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get properties of capture description. + * + * @return the captureDescription value + */ + public CaptureDescription captureDescription() { + return this.captureDescription; + } + + /** + * Set properties of capture description. + * + * @param captureDescription the captureDescription value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withCaptureDescription(CaptureDescription captureDescription) { + this.captureDescription = captureDescription; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesImpl.java new file mode 100644 index 000000000000..7d36fcbc5173 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class MigrationConfigPropertiesImpl extends CreatableUpdatableImpl implements MigrationConfigProperties, MigrationConfigProperties.Definition, MigrationConfigProperties.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + + MigrationConfigPropertiesImpl(String name, ServiceBusManager manager) { + super(name, new MigrationConfigPropertiesInner()); + this.manager = manager; + // Set resource name + this.namespaceName = name; + // + } + + MigrationConfigPropertiesImpl(MigrationConfigPropertiesInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.namespaceName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + MigrationConfigsInner client = this.manager().inner().migrationConfigs(); + return client.createAndStartMigrationAsync(this.resourceGroupName, this.namespaceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MigrationConfigsInner client = this.manager().inner().migrationConfigs(); + return client.createAndStartMigrationAsync(this.resourceGroupName, this.namespaceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MigrationConfigsInner client = this.manager().inner().migrationConfigs(); + return client.getAsync(this.resourceGroupName, this.namespaceName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String migrationState() { + return this.inner().migrationState(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long pendingReplicationOperationsCount() { + return this.inner().pendingReplicationOperationsCount(); + } + + @Override + public String postMigrationName() { + return this.inner().postMigrationName(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String targetNamespace() { + return this.inner().targetNamespace(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public MigrationConfigPropertiesImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public MigrationConfigPropertiesImpl withPostMigrationName(String postMigrationName) { + this.inner().withPostMigrationName(postMigrationName); + return this; + } + + @Override + public MigrationConfigPropertiesImpl withTargetNamespace(String targetNamespace) { + this.inner().withTargetNamespace(targetNamespace); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesInner.java new file mode 100644 index 000000000000..8ff21066d5fa --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigPropertiesInner.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in List or Get Migration Config operation. + */ +@JsonFlatten +public class MigrationConfigPropertiesInner extends ProxyResource { + /** + * Provisioning state of Migration Configuration. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "properties.pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long pendingReplicationOperationsCount; + + /** + * Existing premium Namespace ARM Id name which has no entities, will be + * used for migration. + */ + @JsonProperty(value = "properties.targetNamespace", required = true) + private String targetNamespace; + + /** + * Name to access Standard Namespace after migration. + */ + @JsonProperty(value = "properties.postMigrationName", required = true) + private String postMigrationName; + + /** + * State in which Standard to Premium Migration is, possible values : + * Unknown, Reverting, Completing, Initiating, Syncing, Active. + */ + @JsonProperty(value = "properties.migrationState", access = JsonProperty.Access.WRITE_ONLY) + private String migrationState; + + /** + * Get provisioning state of Migration Configuration. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Get existing premium Namespace ARM Id name which has no entities, will be used for migration. + * + * @return the targetNamespace value + */ + public String targetNamespace() { + return this.targetNamespace; + } + + /** + * Set existing premium Namespace ARM Id name which has no entities, will be used for migration. + * + * @param targetNamespace the targetNamespace value to set + * @return the MigrationConfigPropertiesInner object itself. + */ + public MigrationConfigPropertiesInner withTargetNamespace(String targetNamespace) { + this.targetNamespace = targetNamespace; + return this; + } + + /** + * Get name to access Standard Namespace after migration. + * + * @return the postMigrationName value + */ + public String postMigrationName() { + return this.postMigrationName; + } + + /** + * Set name to access Standard Namespace after migration. + * + * @param postMigrationName the postMigrationName value to set + * @return the MigrationConfigPropertiesInner object itself. + */ + public MigrationConfigPropertiesInner withPostMigrationName(String postMigrationName) { + this.postMigrationName = postMigrationName; + return this; + } + + /** + * Get state in which Standard to Premium Migration is, possible values : Unknown, Reverting, Completing, Initiating, Syncing, Active. + * + * @return the migrationState value + */ + public String migrationState() { + return this.migrationState; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsImpl.java new file mode 100644 index 000000000000..b55a54f89404 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsImpl.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigProperties; + +class MigrationConfigsImpl extends WrapperImpl implements MigrationConfigs { + private final ServiceBusManager manager; + + MigrationConfigsImpl(ServiceBusManager manager) { + super(manager.inner().migrationConfigs()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public MigrationConfigPropertiesImpl define(String name) { + return wrapModel(name); + } + + private MigrationConfigPropertiesImpl wrapModel(MigrationConfigPropertiesInner inner) { + return new MigrationConfigPropertiesImpl(inner, manager()); + } + + private MigrationConfigPropertiesImpl wrapModel(String name) { + return new MigrationConfigPropertiesImpl(name, this.manager()); + } + + @Override + public Completable completeMigrationAsync(String resourceGroupName, String namespaceName) { + MigrationConfigsInner client = this.inner(); + return client.completeMigrationAsync(resourceGroupName, namespaceName).toCompletable(); + } + + @Override + public Completable revertAsync(String resourceGroupName, String namespaceName) { + MigrationConfigsInner client = this.inner(); + return client.revertAsync(resourceGroupName, namespaceName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + MigrationConfigsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MigrationConfigProperties call(MigrationConfigPropertiesInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName) { + MigrationConfigsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName) + .flatMap(new Func1>() { + @Override + public Observable call(MigrationConfigPropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MigrationConfigProperties)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName) { + MigrationConfigsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName).toCompletable(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsInner.java new file mode 100644 index 000000000000..f0be6f16349f --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/MigrationConfigsInner.java @@ -0,0 +1,840 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 MigrationConfigs. + */ +public class MigrationConfigsInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private MigrationConfigsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of MigrationConfigsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MigrationConfigsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(MigrationConfigsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MigrationConfigs to be + * used by Retrofit to perform actually REST calls. + */ + interface MigrationConfigsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs createAndStartMigration" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}") + Observable> createAndStartMigration(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("configName") String configName, @Path("subscriptionId") String subscriptionId, @Body MigrationConfigPropertiesInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs beginCreateAndStartMigration" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}") + Observable> beginCreateAndStartMigration(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("configName") String configName, @Path("subscriptionId") String subscriptionId, @Body MigrationConfigPropertiesInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("configName") String configName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("configName") String configName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs completeMigration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade") + Observable> completeMigration(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("configName") String configName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs revert" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert") + Observable> revert(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("configName") String configName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MigrationConfigPropertiesInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MigrationConfigPropertiesInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MigrationConfigPropertiesInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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)); + } + }); + } + + /** + * Gets all migrationConfigurations. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MigrationConfigPropertiesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MigrationConfigPropertiesInner object if successful. + */ + public MigrationConfigPropertiesInner createAndStartMigration(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters) { + return createAndStartMigrationWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @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 createAndStartMigrationAsync(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createAndStartMigrationWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAndStartMigrationAsync(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters) { + return createAndStartMigrationWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, MigrationConfigPropertiesInner>() { + @Override + public MigrationConfigPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createAndStartMigrationWithServiceResponseAsync(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String configName = "$default"; + final String apiVersion = "2017-04-01"; + Observable> observable = service.createAndStartMigration(resourceGroupName, namespaceName, configName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MigrationConfigPropertiesInner object if successful. + */ + public MigrationConfigPropertiesInner beginCreateAndStartMigration(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters) { + return beginCreateAndStartMigrationWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @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 beginCreateAndStartMigrationAsync(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateAndStartMigrationWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MigrationConfigPropertiesInner object + */ + public Observable beginCreateAndStartMigrationAsync(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters) { + return beginCreateAndStartMigrationWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, MigrationConfigPropertiesInner>() { + @Override + public MigrationConfigPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters required to create Migration Configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MigrationConfigPropertiesInner object + */ + public Observable> beginCreateAndStartMigrationWithServiceResponseAsync(String resourceGroupName, String namespaceName, MigrationConfigPropertiesInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String configName = "$default"; + final String apiVersion = "2017-04-01"; + return service.beginCreateAndStartMigration(resourceGroupName, namespaceName, configName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateAndStartMigrationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateAndStartMigrationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String configName = "$default"; + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, configName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MigrationConfigPropertiesInner object if successful. + */ + public MigrationConfigPropertiesInner get(String resourceGroupName, String namespaceName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 getAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MigrationConfigPropertiesInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, MigrationConfigPropertiesInner>() { + @Override + public MigrationConfigPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MigrationConfigPropertiesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String configName = "$default"; + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, configName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void completeMigration(String resourceGroupName, String namespaceName) { + completeMigrationWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 completeMigrationAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(completeMigrationWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable completeMigrationAsync(String resourceGroupName, String namespaceName) { + return completeMigrationWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> completeMigrationWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String configName = "$default"; + final String apiVersion = "2017-04-01"; + return service.completeMigration(resourceGroupName, namespaceName, configName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = completeMigrationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse completeMigrationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void revert(String resourceGroupName, String namespaceName) { + revertWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 revertAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revertWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable revertAsync(String resourceGroupName, String namespaceName) { + return revertWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> revertWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String configName = "$default"; + final String apiVersion = "2017-04-01"; + return service.revert(resourceGroupName, namespaceName, configName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = revertDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse revertDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all migrationConfigurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MigrationConfigPropertiesInner> 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(); + } + }; + } + + /** + * Gets all migrationConfigurations. + * + * @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); + } + + /** + * Gets all migrationConfigurations. + * + * @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<MigrationConfigPropertiesInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all migrationConfigurations. + * + * @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<MigrationConfigPropertiesInner> 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)); + } + }); + } + + /** + * Gets all migrationConfigurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MigrationConfigPropertiesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespaceSBAuthorizationRuleImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespaceSBAuthorizationRuleImpl.java new file mode 100644 index 000000000000..bf785e29a524 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespaceSBAuthorizationRuleImpl.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.NamespaceSBAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; + +class NamespaceSBAuthorizationRuleImpl extends CreatableUpdatableImpl implements NamespaceSBAuthorizationRule, NamespaceSBAuthorizationRule.Definition, NamespaceSBAuthorizationRule.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private List crights; + private List urights; + + NamespaceSBAuthorizationRuleImpl(String name, ServiceBusManager manager) { + super(name, new SBAuthorizationRuleInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + } + + NamespaceSBAuthorizationRuleImpl(SBAuthorizationRuleInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.crights) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.urights) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName); + } + + @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 List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceSBAuthorizationRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceSBAuthorizationRuleImpl withRights(List rights) { + if (isInCreateMode()) { + this.crights = rights; + } else { + this.urights = rights; + } + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesImpl.java index 7b4b153587c4..0421d5369818 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesImpl.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesImpl.java @@ -22,9 +22,14 @@ import rx.functions.Func1; import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.NameSpaceType; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.IpFilterRule; -import com.microsoft.azure.management.servicebus.v2018_01_01_preview.VirtualNetworkRule; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.VirtualNetworkRule; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.NamespaceSBAuthorizationRule; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RegenerateAccessKeyParameters; class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { protected NamespacesImpl(ServiceBusManager manager) { @@ -128,6 +133,24 @@ public SBNamespaceImpl define(String name) { return wrapModel(name); } + @Override + public Completable migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { + NamespacesInner client = this.inner(); + return client.migrateAsync(resourceGroupName, namespaceName, targetNamespaceType).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityMethodAsync(String name) { + NamespacesInner client = this.inner(); + return client.checkNameAvailabilityMethodAsync(name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + @Override protected SBNamespaceImpl wrapModel(SBNamespaceInner inner) { return new SBNamespaceImpl(inner.name(), inner, manager()); @@ -148,6 +171,11 @@ public VirtualNetworkRuleImpl defineVirtualnetworkrule(String name) { return wrapVirtualnetworkruleModel(name); } + @Override + public NamespaceSBAuthorizationRuleImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + private IpFilterRuleImpl wrapIpfilterruleModel(String name) { return new IpFilterRuleImpl(name, this.manager()); } @@ -156,6 +184,10 @@ private VirtualNetworkRuleImpl wrapVirtualnetworkruleModel(String name) { return new VirtualNetworkRuleImpl(name, this.manager()); } + private NamespaceSBAuthorizationRuleImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceSBAuthorizationRuleImpl(name, this.manager()); + } + private IpFilterRuleImpl wrapIpFilterRuleModel(IpFilterRuleInner inner) { return new IpFilterRuleImpl(inner, manager()); } @@ -164,6 +196,10 @@ private VirtualNetworkRuleImpl wrapVirtualNetworkRuleModel(VirtualNetworkRuleInn return new VirtualNetworkRuleImpl(inner, manager()); } + private NamespaceSBAuthorizationRuleImpl wrapNamespaceSBAuthorizationRuleModel(SBAuthorizationRuleInner inner) { + return new NamespaceSBAuthorizationRuleImpl(inner, manager()); + } + private Observable getIpFilterRuleInnerUsingNamespacesInnerAsync(String id) { String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); @@ -180,14 +216,26 @@ private Observable getVirtualNetworkRuleInnerUsingNames return client.getVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName); } + private Observable getSBAuthorizationRuleInnerUsingNamespacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); + } + @Override public Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { NamespacesInner client = this.inner(); return client.getIpFilterRuleAsync(resourceGroupName, namespaceName, ipFilterRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public IpFilterRule call(IpFilterRuleInner inner) { - return wrapIpFilterRuleModel(inner); + public Observable call(IpFilterRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((IpFilterRule)wrapIpFilterRuleModel(inner)); + } } }); } @@ -216,14 +264,42 @@ public Completable deleteIpFilterRuleAsync(String resourceGroupName, String name return client.deleteIpFilterRuleAsync(resourceGroupName, namespaceName, ipFilterRuleName).toCompletable(); } + @Override + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + NamespacesInner client = this.inner(); + return client.createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + NamespacesInner client = this.inner(); + return client.getNetworkRuleSetAsync(resourceGroupName, namespaceName) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + }); + } + @Override public Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { NamespacesInner client = this.inner(); return client.getVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { - return wrapVirtualNetworkRuleModel(inner); + public Observable call(VirtualNetworkRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VirtualNetworkRule)wrapVirtualNetworkRuleModel(inner)); + } } }); } @@ -253,25 +329,65 @@ public Completable deleteVirtualNetworkRuleAsync(String resourceGroupName, Strin } @Override - public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { NamespacesInner client = this.inner(); - return client.createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) - .map(new Func1() { + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(new Func1>() { @Override - public NetworkRuleSet call(NetworkRuleSetInner inner) { - return new NetworkRuleSetImpl(inner, manager()); + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((NamespaceSBAuthorizationRule)wrapNamespaceSBAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { + return wrapNamespaceSBAuthorizationRuleModel(inner); } }); } @Override - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { NamespacesInner client = this.inner(); - return client.getNetworkRuleSetAsync(resourceGroupName, namespaceName) - .map(new Func1() { + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { @Override - public NetworkRuleSet call(NetworkRuleSetInner inner) { - return new NetworkRuleSetImpl(inner, manager()); + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + NamespacesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); } }); } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesInner.java index 164131dfcce4..b72c58cb9cfa 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesInner.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NamespacesInner.java @@ -15,7 +15,12 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CheckNameAvailability; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.NameSpaceType; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RegenerateAccessKeyParameters; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBNamespaceMigrate; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBNamespaceUpdateParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -33,6 +38,7 @@ 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; @@ -66,6 +72,22 @@ public NamespacesInner(Retrofit retrofit, ServiceBusManagementClientImpl client) * used by Retrofit to perform actually REST calls. */ interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces listIpFilterRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules") + Observable> listIpFilterRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces createOrUpdateIpFilterRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + Observable> createOrUpdateIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Body IpFilterRuleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces deleteIpFilterRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", method = "DELETE", hasBody = true) + Observable> deleteIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces getIpFilterRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + Observable> getIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -98,21 +120,13 @@ interface NamespacesService { @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}") Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body SBNamespaceUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces listIpFilterRules" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules") - Observable> listIpFilterRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces createOrUpdateIpFilterRule" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") - Observable> createOrUpdateIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Body IpFilterRuleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces deleteIpFilterRule" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", method = "DELETE", hasBody = true) - Observable> deleteIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces createOrUpdateNetworkRuleSet" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkrulesets/default") + Observable> createOrUpdateNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetInner parameters, @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.servicebus.v2018_01_01_preview.Namespaces getIpFilterRule" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") - Observable> getIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces getNetworkRuleSet" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkrulesets/default") + Observable> getNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces listVirtualNetworkRules" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules") @@ -130,13 +144,41 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}") Observable> getVirtualNetworkRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces createOrUpdateNetworkRuleSet" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkrulesets/default") - Observable> createOrUpdateNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetInner parameters, @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.servicebus.v2018_01_01_preview.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces getNetworkRuleSet" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkrulesets/default") - Observable> getNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SBAuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces checkNameAvailabilityMethod" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability") + Observable> checkNameAvailabilityMethod(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailability parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces migrate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate") + Observable> migrate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SBNamespaceMigrate parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces listIpFilterRulesNext" }) + @GET + Observable> listIpFilterRulesNext(@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.servicebus.v2018_01_01_preview.Namespaces listNext" }) @GET @@ -146,109 +188,123 @@ interface NamespacesService { @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.servicebus.v2018_01_01_preview.Namespaces listIpFilterRulesNext" }) - @GET - Observable> listIpFilterRulesNext(@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.servicebus.v2018_01_01_preview.Namespaces listVirtualNetworkRulesNext" }) @GET Observable> listVirtualNetworkRulesNext(@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.servicebus.v2018_01_01_preview.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Gets a list of IP Filter rules for a Namespace. * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<SBNamespaceInner> object if successful. + * @return the PagedList<IpFilterRuleInner> object if successful. */ - public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listIpFilterRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listIpFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Gets a list of IP Filter rules for a Namespace. * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listAsync(final ListOperationCallback serviceCallback) { + public ServiceFuture> listIpFilterRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { + listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listIpFilterRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Gets a list of IP Filter rules for a Namespace. * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBNamespaceInner> object + * @return the observable to the PagedList<IpFilterRuleInner> object */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { + public Observable> listIpFilterRulesAsync(final String resourceGroupName, final String namespaceName) { + return listIpFilterRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Gets a list of IP Filter rules for a Namespace. * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBNamespaceInner> object + * @return the observable to the PagedList<IpFilterRuleInner> object */ - public Observable>> listWithServiceResponseAsync() { - return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { + public Observable>> listIpFilterRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listIpFilterRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Gets a list of IP Filter rules for a Namespace. * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync() { + public Observable>> listIpFilterRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-01-01-preview"; + return service.listIpFilterRules(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listIpFilterRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -256,114 +312,98 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listIpFilterRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets the available namespaces within a resource group. + * Creates or updates an IpFilterRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<SBNamespaceInner> object if successful. + * @return the IpFilterRuleInner 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(); - } - }; + public IpFilterRuleInner createOrUpdateIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).toBlocking().single().body(); } /** - * Gets the available namespaces within a resource group. + * Creates or updates an IpFilterRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @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); + public ServiceFuture createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters), serviceCallback); } /** - * Gets the available namespaces within a resource group. + * Creates or updates an IpFilterRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBNamespaceInner> object + * @return the observable to the IpFilterRuleInner object */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { - return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).map(new Func1, IpFilterRuleInner>() { + @Override + public IpFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets the available namespaces within a resource group. + * Creates or updates an IpFilterRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBNamespaceInner> 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)); - } - }); - } - - /** - * Gets the available namespaces within a resource group. - * - ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the IpFilterRuleInner object */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + public Observable> createOrUpdateIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (ipFilterRuleName == null) { + throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + } 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."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = createOrUpdateIpFilterRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -371,53 +411,770 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse createOrUpdateIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule 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 deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (ipFilterRuleName == null) { + throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteIpFilterRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IpFilterRuleInner object if successful. + */ + public IpFilterRuleInner getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule 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 getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IpFilterRuleInner object + */ + public Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, IpFilterRuleInner>() { + @Override + public IpFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IpFilterRuleInner object + */ + public Observable> getIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (ipFilterRuleName == null) { + throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIpFilterRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBNamespaceInner> 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(); + } + }; + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @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); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBNamespaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBNamespaceInner> 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)); + } + }); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBNamespaceInner> 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."); + } + final String apiVersion = "2018-01-01-preview"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBNamespaceInner> 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(); + } + }; + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBNamespaceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBNamespaceInner> 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)); + } + }); + } + + /** + * Gets the available namespaces within a resource group. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBNamespaceInner object if successful. + */ + public SBNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace 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 createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + @Override + public SBNamespaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBNamespaceInner object if successful. + */ + public SBNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace 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 beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBNamespaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + @Override + public SBNamespaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + /** * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBNamespaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.beginCreateOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SBNamespaceInner object if successful. */ - public SBNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); + public SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets a description for the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace 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 createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets a description for the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the SBNamespaceInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, SBNamespaceInner>() { @Override public SBNamespaceInner call(ServiceResponse response) { return response.body(); @@ -426,15 +1183,102 @@ public SBNamespaceInner call(ServiceResponse response) { } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets a description for the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the SBNamespaceInner object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBNamespaceInner object if successful. + */ + public SBNamespaceInner update(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters supplied to update a namespace 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 namespaceName, SBNamespaceUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBNamespaceInner object + */ + public Observable updateAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + @Override + public SBNamespaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBNamespaceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -447,71 +1291,88 @@ public Observable> createOrUpdateWithServiceRe if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } Validator.validate(parameters); - Observable> observable = service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + final String apiVersion = "2018-01-01-preview"; + return service.update(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name + * @param parameters The Namespace NetworkRuleSet. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SBNamespaceInner object if successful. + * @return the NetworkRuleSetInner object if successful. */ - public SBNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name + * @param parameters The Namespace NetworkRuleSet. * @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 namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name + * @param parameters The Namespace NetworkRuleSet. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { @Override - public SBNamespaceInner call(ServiceResponse response) { + public NetworkRuleSetInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name + * @param parameters The Namespace NetworkRuleSet. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -524,16 +1385,14 @@ public Observable> beginCreateOrUpdateWithServ if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } Validator.validate(parameters); - return service.beginCreateOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + return service.createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -542,30 +1401,29 @@ public Observable> call(Response }); } - private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkRuleSetInner object if successful. */ - public void delete(String resourceGroupName, String namespaceName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name @@ -573,36 +1431,36 @@ public void delete(String resourceGroupName, String namespaceName) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the NetworkRuleSetInner object */ - public Observable deleteAsync(String resourceGroupName, String namespaceName) { - return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { @Override - public Void call(ServiceResponse response) { + public NetworkRuleSetInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the NetworkRuleSetInner object */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -612,28 +1470,50 @@ public Observable> deleteWithServiceResponseAsync(String r 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."); - } - Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + final String apiVersion = "2018-01-01-preview"; + return service.getNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkRuleInner> object if successful. */ - public void beginDelete(String resourceGroupName, String namespaceName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public PagedList listVirtualNetworkRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name @@ -641,36 +1521,67 @@ public void beginDelete(String resourceGroupName, String namespaceName) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName) { + return listVirtualNetworkRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable>> listVirtualNetworkRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualNetworkRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -680,16 +1591,14 @@ public Observable> beginDeleteWithServiceResponseAsync(Str 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.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + return service.listVirtualNetworkRules(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listVirtualNetworkRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -697,86 +1606,92 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, 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()) + private ServiceResponse> listVirtualNetworkRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a description for the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SBNamespaceInner object if successful. + * @return the VirtualNetworkRuleInner object if successful. */ - public SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); } /** - * Gets a description for the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule 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 getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); } /** - * Gets a description for the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, SBNamespaceInner>() { + public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { @Override - public SBNamespaceInner call(ServiceResponse response) { + public VirtualNetworkRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets a description for the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } 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.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + final String virtualNetworkSubnetId = null; + VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); + parameters.withVirtualNetworkSubnetId(null); + return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getByResourceGroupDelegate(response); + ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -785,92 +1700,88 @@ public Observable> call(Response }); } - private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters Parameters supplied to update a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SBNamespaceInner object if successful. + * @return the VirtualNetworkRuleInner object if successful. */ - public SBNamespaceInner update(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).toBlocking().single().body(); } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters Parameters supplied to update a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet * @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 namespaceName, SBNamespaceUpdateParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId), serviceCallback); } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters Parameters supplied to update a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable updateAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).map(new Func1, VirtualNetworkRuleInner>() { @Override - public SBNamespaceInner call(ServiceResponse response) { + public VirtualNetworkRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters Parameters supplied to update a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.update(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); + parameters.withVirtualNetworkSubnetId(virtualNetworkSubnetId); + return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -879,124 +1790,89 @@ public Observable> call(Response }); } - private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<IpFilterRuleInner> object if successful. */ - public PagedList listIpFilterRules(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listIpFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public void deleteVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule 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> listIpFilterRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listIpFilterRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<IpFilterRuleInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listIpFilterRulesAsync(final String resourceGroupName, final String namespaceName) { - return listIpFilterRulesWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<IpFilterRuleInner> object - */ - public Observable>> listIpFilterRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName) - .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(listIpFilterRulesNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Gets a list of IP Filter rules for a Namespace. - * - ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The namespace name - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> listIpFilterRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + public Observable> deleteVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } 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.listIpFilterRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-01-01-preview"; + return service.deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listIpFilterRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = deleteVirtualNetworkRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -1004,99 +1880,90 @@ public Observable>> call(Response> listIpFilterRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse deleteVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the IpFilterRuleInner object if successful. + * @return the VirtualNetworkRuleInner object if successful. */ - public IpFilterRuleInner createOrUpdateIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { - return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).toBlocking().single().body(); + public VirtualNetworkRuleInner getVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule 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 createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters), serviceCallback); + public ServiceFuture getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { - return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).map(new Func1, IpFilterRuleInner>() { + public Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { @Override - public IpFilterRuleInner call(ServiceResponse response) { + public VirtualNetworkRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable> createOrUpdateIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + public Observable> getVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (ipFilterRuleName == null) { - throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + return service.getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateIpFilterRuleDelegate(response); + ServiceResponse clientResponse = getVirtualNetworkRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1105,184 +1972,220 @@ public Observable> call(Response createOrUpdateIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes an IpFilterRule for a Namespace. + * Gets the authorization rules for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. */ - public void deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Deletes an IpFilterRule for a Namespace. + * Gets the authorization rules for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule 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 deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Deletes an IpFilterRule for a Namespace. + * Gets the authorization rules for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<SBAuthorizationRuleInner> object */ - public Observable deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - return deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Deletes an IpFilterRule for a Namespace. + * Gets the authorization rules for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<SBAuthorizationRuleInner> object */ - public Observable> deleteIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for a namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (ipFilterRuleName == null) { - throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); - } 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.deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = deleteIpFilterRuleDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } - }); - } - - private ServiceResponse deleteIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Creates or updates an authorization rule for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the IpFilterRuleInner object if successful. + * @return the SBAuthorizationRuleInner object if successful. */ - public IpFilterRuleInner getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Creates or updates an authorization rule for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @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 getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights), serviceCallback); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Creates or updates an authorization rule for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, IpFilterRuleInner>() { + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { @Override - public IpFilterRuleInner call(ServiceResponse response) { + public SBAuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Creates or updates an authorization rule for a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable> getIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (ipFilterRuleName == null) { - throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } 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."); + if (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); } - return service.getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(rights); + final String apiVersion = "2017-04-01"; + SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getIpFilterRuleDelegate(response); + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1291,122 +2194,89 @@ public Observable> call(Response getIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Deletes a namespace authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<VirtualNetworkRuleInner> object if successful. */ - public PagedList listVirtualNetworkRules(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Deletes a namespace authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule 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> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Deletes a namespace authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<VirtualNetworkRuleInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName) { - return listVirtualNetworkRulesWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Deletes a namespace authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<VirtualNetworkRuleInner> object - */ - public Observable>> listVirtualNetworkRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName) - .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(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Gets a list of VirtualNetwork rules for a Namespace. - * - ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The namespace name - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> listVirtualNetworkRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } 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.listVirtualNetworkRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2017-04-01"; + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listVirtualNetworkRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -1414,94 +2284,90 @@ public Observable>> call(Response< }); } - private ServiceResponse> listVirtualNetworkRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets an authorization rule for a namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualNetworkRuleInner object if successful. + * @return the SBAuthorizationRuleInner object if successful. */ - public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets an authorization rule for a namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule 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 createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets an authorization rule for a namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { @Override - public VirtualNetworkRuleInner call(ServiceResponse response) { + public SBAuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets an authorization rule for a namespace by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } 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 virtualNetworkSubnetId = null; - VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); - parameters.withVirtualNetworkSubnetId(null); - return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1510,90 +2376,89 @@ public Observable> call(Response getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets the primary and secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualNetworkRuleInner object if successful. + * @return the AccessKeysInner object if successful. */ - public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).toBlocking().single().body(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets the primary and secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule 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 createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId), serviceCallback); + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets the primary and secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the AccessKeysInner object */ - public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).map(new Func1, VirtualNetworkRuleInner>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AccessKeysInner>() { @Override - public VirtualNetworkRuleInner call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets the primary and secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId Resource ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the AccessKeysInner object */ - public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } 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."); - } - VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); - parameters.withVirtualNetworkSubnetId(virtualNetworkSubnetId); - return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = listKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1602,90 +2467,97 @@ public Observable> call(Response createOrUpdateVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Regenerates the primary or secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. */ - public void deleteVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Regenerates the primary or secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @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 deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Regenerates the primary or secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the AccessKeysInner object */ - public Observable deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, Void>() { + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { @Override - public Void call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Regenerates the primary or secondary connection strings for the namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the AccessKeysInner object */ - public Observable> deleteVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } 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."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - return service.deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = regenerateKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1694,92 +2566,77 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Check the give namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualNetworkRuleInner object if successful. + * @return the CheckNameAvailabilityResultInner object if successful. */ - public VirtualNetworkRuleInner getVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); + public CheckNameAvailabilityResultInner checkNameAvailabilityMethod(String name) { + return checkNameAvailabilityMethodWithServiceResponseAsync(name).toBlocking().single().body(); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Check the give namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @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 getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); + public ServiceFuture checkNameAvailabilityMethodAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityMethodWithServiceResponseAsync(name), serviceCallback); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Check the give namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + public Observable checkNameAvailabilityMethodAsync(String name) { + return checkNameAvailabilityMethodWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { @Override - public VirtualNetworkRuleInner call(ServiceResponse response) { + public CheckNameAvailabilityResultInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Check the give namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable> getVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (namespaceName == null) { - throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); - } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); - } + public Observable> checkNameAvailabilityMethodWithServiceResponseAsync(String name) { 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."); + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - return service.getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + CheckNameAvailability parameters = new CheckNameAvailability(); + parameters.withName(name); + return service.checkNameAvailabilityMethod(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = checkNameAvailabilityMethodDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1788,70 +2645,69 @@ public Observable> call(Response getVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse checkNameAvailabilityMethodDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets NetworkRuleSet for a Namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters The Namespace IpFilterRule. + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the NetworkRuleSetInner object if successful. */ - public NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public void migrate(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { + migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType).toBlocking().single().body(); } /** - * Gets NetworkRuleSet for a Namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters The Namespace IpFilterRule. + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @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 createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + */ + public ServiceFuture migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType), serviceCallback); } /** - * Gets NetworkRuleSet for a Namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters The Namespace IpFilterRule. + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { + public Observable migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { + return migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType).map(new Func1, Void>() { @Override - public NetworkRuleSetInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets NetworkRuleSet for a Namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param parameters The Namespace IpFilterRule. + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + public Observable> migrateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1861,19 +2717,18 @@ public Observable> createOrUpdateNetworkRul 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."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + if (targetNamespaceType == null) { + throw new IllegalArgumentException("Parameter targetNamespaceType is required and cannot be null."); } - Validator.validate(parameters); - return service.createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + SBNamespaceMigrate parameters = new SBNamespaceMigrate(); + parameters.withTargetNamespaceType(targetNamespaceType); + return service.migrate(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); + ServiceResponse clientResponse = migrateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1882,85 +2737,110 @@ public Observable> call(Response createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse migrateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name + * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the NetworkRuleSetInner object if successful. + * @return the PagedList<IpFilterRuleInner> object if successful. */ - public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public PagedList listIpFilterRulesNext(final String nextPageLink) { + ServiceResponse> response = listIpFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listIpFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name + * @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 getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture> listIpFilterRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listIpFilterRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listIpFilterRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name + * @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 NetworkRuleSetInner object + * @return the observable to the PagedList<IpFilterRuleInner> object */ - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { - @Override - public NetworkRuleSetInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listIpFilterRulesNextAsync(final String nextPageLink) { + return listIpFilterRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name + * @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 NetworkRuleSetInner object + * @return the observable to the PagedList<IpFilterRuleInner> object */ - public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (namespaceName == null) { - throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); - } - 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."); + public Observable>> listIpFilterRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listIpFilterRulesNextSinglePageAsync(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(listIpFilterRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listIpFilterRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } - return service.getNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String nextUrl = String.format("%s", nextPageLink); + return service.listIpFilterRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listIpFilterRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1968,9 +2848,9 @@ public Observable> call(Response getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> listIpFilterRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -2198,26 +3078,26 @@ private ServiceResponse> listByResourceGroupNextDeleg } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<IpFilterRuleInner> object if successful. + * @return the PagedList<VirtualNetworkRuleInner> object if successful. */ - public PagedList listIpFilterRulesNext(final String nextPageLink) { - ServiceResponse> response = listIpFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listVirtualNetworkRulesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listIpFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -2225,75 +3105,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listIpFilterRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listVirtualNetworkRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listIpFilterRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listVirtualNetworkRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listIpFilterRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @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<IpFilterRuleInner> object + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable> listIpFilterRulesNextAsync(final String nextPageLink) { - return listIpFilterRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listVirtualNetworkRulesNextAsync(final String nextPageLink) { + return listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @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<IpFilterRuleInner> object + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable>> listIpFilterRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listIpFilterRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listVirtualNetworkRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listIpFilterRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listIpFilterRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listVirtualNetworkRulesNextSinglePageAsync(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.listIpFilterRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listVirtualNetworkRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listIpFilterRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listVirtualNetworkRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2301,34 +3181,34 @@ public Observable>> call(Response> listIpFilterRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listVirtualNetworkRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets the authorization rules for a namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<VirtualNetworkRuleInner> object if successful. + * @return the PagedList<SBAuthorizationRuleInner> object if successful. */ - public PagedList listVirtualNetworkRulesNext(final String nextPageLink) { - ServiceResponse> response = listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets the authorization rules for a namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -2336,75 +3216,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listVirtualNetworkRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listVirtualNetworkRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets the authorization rules for a namespace. * * @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<VirtualNetworkRuleInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> object */ - public Observable> listVirtualNetworkRulesNextAsync(final String nextPageLink) { - return listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets the authorization rules for a namespace. * * @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<VirtualNetworkRuleInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> object */ - public Observable>> listVirtualNetworkRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets the authorization rules for a namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listVirtualNetworkRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listVirtualNetworkRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listVirtualNetworkRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2412,9 +3292,9 @@ public Observable>> call(Response< }); } - private ServiceResponse> listVirtualNetworkRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java index 928316721baa..9e6d025499da 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java @@ -47,6 +47,11 @@ public String name() { return this.inner().name(); } + @Override + public Boolean trustedServiceAccessEnabled() { + return this.inner().trustedServiceAccessEnabled(); + } + @Override public String type() { return this.inner().type(); diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetInner.java index 85457e7e6fae..d34fe8aaaf0f 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetInner.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/NetworkRuleSetInner.java @@ -21,6 +21,12 @@ */ @JsonFlatten public class NetworkRuleSetInner extends ProxyResource { + /** + * Value that indicates whether Trusted Service Access is Enabled or not. + */ + @JsonProperty(value = "properties.trustedServiceAccessEnabled") + private Boolean trustedServiceAccessEnabled; + /** * Default Action for Network Rule Set. Possible values include: 'Allow', * 'Deny'. @@ -40,6 +46,26 @@ public class NetworkRuleSetInner extends ProxyResource { @JsonProperty(value = "properties.ipRules") private List ipRules; + /** + * Get value that indicates whether Trusted Service Access is Enabled or not. + * + * @return the trustedServiceAccessEnabled value + */ + public Boolean trustedServiceAccessEnabled() { + return this.trustedServiceAccessEnabled; + } + + /** + * Set value that indicates whether Trusted Service Access is Enabled or not. + * + * @param trustedServiceAccessEnabled the trustedServiceAccessEnabled value to set + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withTrustedServiceAccessEnabled(Boolean trustedServiceAccessEnabled) { + this.trustedServiceAccessEnabled = trustedServiceAccessEnabled; + return this; + } + /** * Get default Action for Network Rule Set. Possible values include: 'Allow', 'Deny'. * diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/OperationsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/OperationsInner.java index c15052d6ddce..4d76564bb206 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/OperationsInner.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/OperationsInner.java @@ -145,10 +145,8 @@ public Observable>> call(ServiceResponse>> listSinglePageAsync() { - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -162,7 +160,7 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionImpl.java new file mode 100644 index 000000000000..5fd45e70e862 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegion; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegionProperties; + +class PremiumMessagingRegionImpl extends GroupableResourceCoreImpl implements PremiumMessagingRegion { + PremiumMessagingRegionImpl(String name, PremiumMessagingRegionInner inner, ServiceBusManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PremiumMessagingRegionsInner client = this.manager().inner().premiumMessagingRegions(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + PremiumMessagingRegionsInner client = this.manager().inner().premiumMessagingRegions(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + PremiumMessagingRegionsInner client = this.manager().inner().premiumMessagingRegions(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public PremiumMessagingRegionProperties properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionInner.java new file mode 100644 index 000000000000..6af9bf6b4a66 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ResourceNamespacePatch; + +/** + * Premium Messaging Region. + */ +public class PremiumMessagingRegionInner extends ResourceNamespacePatch { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private PremiumMessagingRegionProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public PremiumMessagingRegionProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the PremiumMessagingRegionInner object itself. + */ + public PremiumMessagingRegionInner withProperties(PremiumMessagingRegionProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsImpl.java new file mode 100644 index 000000000000..f5d607f460f3 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegions; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegion; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PremiumMessagingRegionsImpl extends GroupableResourcesCoreImpl implements PremiumMessagingRegions { + protected PremiumMessagingRegionsImpl(ServiceBusManager manager) { + super(manager.inner().premiumMessagingRegions(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PremiumMessagingRegionsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + PremiumMessagingRegionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PremiumMessagingRegionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PremiumMessagingRegion call(PremiumMessagingRegionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected PremiumMessagingRegionImpl wrapModel(PremiumMessagingRegionInner inner) { + return new PremiumMessagingRegionImpl(inner.name(), inner, manager()); + } + + @Override + protected PremiumMessagingRegionImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsInner.java new file mode 100644 index 000000000000..c71418cc9276 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PremiumMessagingRegionsInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PremiumMessagingRegions. + */ +public class PremiumMessagingRegionsInner { + /** The Retrofit service to perform REST calls. */ + private PremiumMessagingRegionsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PremiumMessagingRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PremiumMessagingRegionsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(PremiumMessagingRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PremiumMessagingRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface PremiumMessagingRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PremiumMessagingRegionInner> 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(); + } + }; + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @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); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PremiumMessagingRegionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PremiumMessagingRegionInner> 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)); + } + }); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PremiumMessagingRegionInner> 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."); + } + final String apiVersion = "2017-04-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PremiumMessagingRegionInner> 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(); + } + }; + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @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); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @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<PremiumMessagingRegionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + * @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<PremiumMessagingRegionInner> 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)); + } + }); + } + + /** + * Gets the available premium messaging regions for servicebus. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PremiumMessagingRegionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..4f3dae9047c1 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ConnectionState; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EndPointProvisioningState; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, ServiceBusManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.privateEndpointConnectionName); + } + + @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 PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public ConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public EndPointProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProvisioningState(EndPointProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..1a2adc1b7de3 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ConnectionState; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EndPointProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Properties of the PrivateEndpointConnection. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The Private Endpoint resource for this Connection. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * Details about the state of the connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private ConnectionState privateLinkServiceConnectionState; + + /** + * Provisioning state of the Private Endpoint Connection. Possible values + * include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', + * 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private EndPointProvisioningState provisioningState; + + /** + * Get the Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the Private Endpoint resource for this Connection. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set details about the state of the connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @return the provisioningState value + */ + public EndPointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(EndPointProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..a1d117a538da --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final ServiceBusManager manager; + + PrivateEndpointConnectionsImpl(ServiceBusManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + private PrivateEndpointConnectionImpl wrapModel(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 000000000000..ee815e2be3d5 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,678 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner parameters, @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.servicebus.v2018_01_01_preview.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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)); + } + }); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace 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 createOrUpdateAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + 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 (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection 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 deleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), privateEndpointConnectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection 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 beginDeleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), privateEndpointConnectionName, 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 ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection 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 getAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.get(resourceGroupName, namespaceName, privateEndpointConnectionName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> 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(); + } + }; + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @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); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> 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)); + } + }); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourceInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..89394e8b28fa --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information of the private link resource. + */ +@JsonFlatten +public class PrivateLinkResourceInner { + /** + * The groupId property. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /** + * Required Members. + */ + @JsonProperty(value = "properties.requiredMembers") + private List requiredMembers; + + /** + * Required Zone Names. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Fully qualified identifier of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the groupId value. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId value. + * + * @param groupId the groupId value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get required Members. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set required Members. + * + * @param requiredMembers the requiredMembers value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get required Zone Names. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set required Zone Names. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Get fully qualified identifier of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set fully qualified identifier of the resource. + * + * @param id the id value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource. + * + * @param name the name value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..8efb31199d7f --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateLinkResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateLinkResourcesListResult; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final ServiceBusManager manager; + + PrivateLinkResourcesImpl(ServiceBusManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName) { + PrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName) + .map(new Func1() { + @Override + public PrivateLinkResourcesListResult call(PrivateLinkResourcesListResultInner inner) { + return new PrivateLinkResourcesListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 000000000000..65ad30556091 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +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 PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateLinkResources") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourcesListResultInner object if successful. + */ + public PrivateLinkResourcesListResultInner get(String resourceGroupName, String namespaceName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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 getAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourcesListResultInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, PrivateLinkResourcesListResultInner>() { + @Override + public PrivateLinkResourcesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourcesListResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.get(resourceGroupName, namespaceName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 000000000000..a136dbc5f54f --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateLinkResourcesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateLinkResourcesListResultImpl extends WrapperImpl implements PrivateLinkResourcesListResult { + private final ServiceBusManager manager; + PrivateLinkResourcesListResultImpl(PrivateLinkResourcesListResultInner inner, ServiceBusManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultInner.java new file mode 100644 index 000000000000..991448d093bd --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/PrivateLinkResourcesListResultInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the List private link resources operation. + */ +public class PrivateLinkResourcesListResultInner { + /** + * A collection of private link resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * A link for the next page of private link resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get a collection of private link resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a collection of private link resources. + * + * @param value the value value to set + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get a link for the next page of private link resources. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set a link for the next page of private link resources. + * + * @param nextLink the nextLink value to set + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueueNamespaceSBAuthorizationRuleImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueueNamespaceSBAuthorizationRuleImpl.java new file mode 100644 index 000000000000..21ccbbe976d6 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueueNamespaceSBAuthorizationRuleImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.QueueNamespaceSBAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; + +class QueueNamespaceSBAuthorizationRuleImpl extends CreatableUpdatableImpl implements QueueNamespaceSBAuthorizationRule, QueueNamespaceSBAuthorizationRule.Definition, QueueNamespaceSBAuthorizationRule.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String queueName; + private String authorizationRuleName; + private List crights; + private List urights; + + QueueNamespaceSBAuthorizationRuleImpl(String name, ServiceBusManager manager) { + super(name, new SBAuthorizationRuleInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + } + + QueueNamespaceSBAuthorizationRuleImpl(SBAuthorizationRuleInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.queueName = IdParsingUtils.getValueFromIdByName(inner.id(), "queues"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizationRules"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.queueName, this.authorizationRuleName, this.crights) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.queueName, this.authorizationRuleName, this.urights) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.queueName, this.authorizationRuleName); + } + + @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 List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public QueueNamespaceSBAuthorizationRuleImpl withExistingQueue(String resourceGroupName, String namespaceName, String queueName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.queueName = queueName; + return this; + } + + @Override + public QueueNamespaceSBAuthorizationRuleImpl withRights(List rights) { + if (isInCreateMode()) { + this.crights = rights; + } else { + this.urights = rights; + } + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesImpl.java new file mode 100644 index 000000000000..caf48dfc1225 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBQueue; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.QueueNamespaceSBAuthorizationRule; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RegenerateAccessKeyParameters; + +class QueuesImpl extends WrapperImpl implements Queues { + private final ServiceBusManager manager; + + QueuesImpl(ServiceBusManager manager) { + super(manager.inner().queues()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public SBQueueImpl define(String name) { + return wrapModel(name); + } + + private SBQueueImpl wrapModel(SBQueueInner inner) { + return new SBQueueImpl(inner, manager()); + } + + private SBQueueImpl wrapModel(String name) { + return new SBQueueImpl(name, this.manager()); + } + + @Override + public Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + QueuesInner client = this.inner(); + return client.listByNamespaceAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SBQueue call(SBQueueInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String queueName) { + QueuesInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, queueName) + .flatMap(new Func1>() { + @Override + public Observable call(SBQueueInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SBQueue)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String queueName) { + QueuesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, queueName).toCompletable(); + } + + @Override + public QueueNamespaceSBAuthorizationRuleImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private QueueNamespaceSBAuthorizationRuleImpl wrapAuthorizationRuleModel(String name) { + return new QueueNamespaceSBAuthorizationRuleImpl(name, this.manager()); + } + + private QueueNamespaceSBAuthorizationRuleImpl wrapQueueNamespaceSBAuthorizationRuleModel(SBAuthorizationRuleInner inner) { + return new QueueNamespaceSBAuthorizationRuleImpl(inner, manager()); + } + + private Observable getSBAuthorizationRuleInnerUsingQueuesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String queueName = IdParsingUtils.getValueFromIdByName(id, "queues"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules"); + QueuesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + QueuesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap(new Func1>() { + @Override + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((QueueNamespaceSBAuthorizationRule)wrapQueueNamespaceSBAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String queueName) { + QueuesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public QueueNamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { + return wrapQueueNamespaceSBAuthorizationRuleModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + QueuesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + QueuesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + QueuesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesInner.java new file mode 100644 index 000000000000..b2f573c40f6c --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/QueuesInner.java @@ -0,0 +1,1504 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RegenerateAccessKeyParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 Queues. + */ +public class QueuesInner { + /** The Retrofit service to perform REST calls. */ + private QueuesService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of QueuesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueuesInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(QueuesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Queues to be + * used by Retrofit to perform actually REST calls. + */ + interface QueuesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SBAuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues") + Observable> listByNamespace(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @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.servicebus.v2018_01_01_preview.Queues createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Body SBQueueInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@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.servicebus.v2018_01_01_preview.Queues listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String queueName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue 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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String queueName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String queueName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, queueName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBAuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String queueName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorization rules for a queue. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, queueName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBAuthorizationRuleInner object if successful. + */ + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights), serviceCallback); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); + } + Validator.validate(rights); + final String apiVersion = "2017-04-01"; + SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule 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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBAuthorizationRuleInner object if successful. + */ + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule 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 listKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, queueName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.regenerateKeys(resourceGroupName, namespaceName, queueName, authorizationRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBQueueInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBQueueInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBQueueInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName) + .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final Integer skip = null; + final Integer top = null; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBQueueInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBQueueInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBQueueInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, 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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the queues within a namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBQueueInner object if successful. + */ + public SBQueueInner createOrUpdate(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue 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 createOrUpdateAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBQueueInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters).map(new Func1, SBQueueInner>() { + @Override + public SBQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBQueueInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, queueName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String queueName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).toBlocking().single().body(); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue 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 deleteAsync(String resourceGroupName, String namespaceName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName), serviceCallback); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String queueName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, queueName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBQueueInner object if successful. + */ + public SBQueueInner get(String resourceGroupName, String namespaceName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).toBlocking().single().body(); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue 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 getAsync(String resourceGroupName, String namespaceName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName), serviceCallback); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBQueueInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).map(new Func1, SBQueueInner>() { + @Override + public SBQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBQueueInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, queueName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all authorization rules for a queue. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorization rules for a queue. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorization rules for a queue. + * + * @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<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorization rules for a queue. + * + * @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<SBAuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorization rules for a queue. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the queues within a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBQueueInner> object if successful. + */ + public PagedList listByNamespaceNext(final String nextPageLink) { + ServiceResponse> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the queues within a namespace. + * + * @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> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the queues within a namespace. + * + * @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<SBQueueInner> object + */ + public Observable> listByNamespaceNextAsync(final String nextPageLink) { + return listByNamespaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the queues within a namespace. + * + * @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<SBQueueInner> object + */ + public Observable>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByNamespaceNextSinglePageAsync(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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the queues within a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceNextSinglePageAsync(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.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsImpl.java new file mode 100644 index 000000000000..f23b6adb45be --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsImpl.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.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Regions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegion; + +class RegionsImpl extends WrapperImpl implements Regions { + private final ServiceBusManager manager; + + RegionsImpl(ServiceBusManager manager) { + super(manager.inner().regions()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable listBySkuAsync(final String sku) { + RegionsInner client = this.inner(); + return client.listBySkuAsync(sku) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PremiumMessagingRegion call(PremiumMessagingRegionInner inner) { + return new PremiumMessagingRegionImpl(inner.name(), inner, manager()); + } + }); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsInner.java new file mode 100644 index 000000000000..c79c34c73868 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RegionsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Regions. + */ +public class RegionsInner { + /** The Retrofit service to perform REST calls. */ + private RegionsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of RegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegionsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(RegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Regions to be + * used by Retrofit to perform actually REST calls. + */ + interface RegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Regions listBySku" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions") + Observable> listBySku(@Path("subscriptionId") String subscriptionId, @Path("sku") String sku, @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.servicebus.v2018_01_01_preview.Regions listBySkuNext" }) + @GET + Observable> listBySkuNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PremiumMessagingRegionInner> object if successful. + */ + public PagedList listBySku(final String sku) { + ServiceResponse> response = listBySkuSinglePageAsync(sku).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku 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> listBySkuAsync(final String sku, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySkuSinglePageAsync(sku), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PremiumMessagingRegionInner> object + */ + public Observable> listBySkuAsync(final String sku) { + return listBySkuWithServiceResponseAsync(sku) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PremiumMessagingRegionInner> object + */ + public Observable>> listBySkuWithServiceResponseAsync(final String sku) { + return listBySkuSinglePageAsync(sku) + .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(listBySkuNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + ServiceResponse> * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PremiumMessagingRegionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySkuSinglePageAsync(final String sku) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (sku == null) { + throw new IllegalArgumentException("Parameter sku is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listBySku(this.client.subscriptionId(), sku, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySkuDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySkuDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the available Regions for a given sku. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PremiumMessagingRegionInner> object if successful. + */ + public PagedList listBySkuNext(final String nextPageLink) { + ServiceResponse> response = listBySkuNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the available Regions for a given sku. + * + * @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> listBySkuNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySkuNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the available Regions for a given sku. + * + * @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<PremiumMessagingRegionInner> object + */ + public Observable> listBySkuNextAsync(final String nextPageLink) { + return listBySkuNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + * @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<PremiumMessagingRegionInner> object + */ + public Observable>> listBySkuNextWithServiceResponseAsync(final String nextPageLink) { + return listBySkuNextSinglePageAsync(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(listBySkuNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PremiumMessagingRegionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySkuNextSinglePageAsync(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.listBySkuNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySkuNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySkuNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleImpl.java new file mode 100644 index 000000000000..0971d8c79934 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Action; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.FilterType; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SqlFilter; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CorrelationFilter; + +class RuleImpl extends CreatableUpdatableImpl implements Rule, Rule.Definition, Rule.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String topicName; + private String subscriptionName; + private String ruleName; + + RuleImpl(String name, ServiceBusManager manager) { + super(name, new RuleInner()); + this.manager = manager; + // Set resource name + this.ruleName = name; + // + } + + RuleImpl(RuleInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.ruleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.topicName = IdParsingUtils.getValueFromIdByName(inner.id(), "topics"); + this.subscriptionName = IdParsingUtils.getValueFromIdByName(inner.id(), "subscriptions"); + this.ruleName = IdParsingUtils.getValueFromIdByName(inner.id(), "rules"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RulesInner client = this.manager().inner().rules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.subscriptionName, this.ruleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RulesInner client = this.manager().inner().rules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.subscriptionName, this.ruleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RulesInner client = this.manager().inner().rules(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.subscriptionName, this.ruleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Action action() { + return this.inner().action(); + } + + @Override + public CorrelationFilter correlationFilter() { + return this.inner().correlationFilter(); + } + + @Override + public FilterType filterType() { + return this.inner().filterType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SqlFilter sqlFilter() { + return this.inner().sqlFilter(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public RuleImpl withExistingSubscription(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.topicName = topicName; + this.subscriptionName = subscriptionName; + return this; + } + + @Override + public RuleImpl withAction(Action action) { + this.inner().withAction(action); + return this; + } + + @Override + public RuleImpl withCorrelationFilter(CorrelationFilter correlationFilter) { + this.inner().withCorrelationFilter(correlationFilter); + return this; + } + + @Override + public RuleImpl withFilterType(FilterType filterType) { + this.inner().withFilterType(filterType); + return this; + } + + @Override + public RuleImpl withSqlFilter(SqlFilter sqlFilter) { + this.inner().withSqlFilter(sqlFilter); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleInner.java new file mode 100644 index 000000000000..3cb32e3c26a0 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RuleInner.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Action; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.FilterType; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SqlFilter; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.CorrelationFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of Rule Resource. + */ +@JsonFlatten +public class RuleInner extends ProxyResource { + /** + * Represents the filter actions which are allowed for the transformation + * of a message that have been matched by a filter expression. + */ + @JsonProperty(value = "properties.action") + private Action action; + + /** + * Filter type that is evaluated against a BrokeredMessage. Possible values + * include: 'SqlFilter', 'CorrelationFilter'. + */ + @JsonProperty(value = "properties.filterType") + private FilterType filterType; + + /** + * Properties of sqlFilter. + */ + @JsonProperty(value = "properties.sqlFilter") + private SqlFilter sqlFilter; + + /** + * Properties of correlationFilter. + */ + @JsonProperty(value = "properties.correlationFilter") + private CorrelationFilter correlationFilter; + + /** + * Get represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. + * + * @param action the action value to set + * @return the RuleInner object itself. + */ + public RuleInner withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get filter type that is evaluated against a BrokeredMessage. Possible values include: 'SqlFilter', 'CorrelationFilter'. + * + * @return the filterType value + */ + public FilterType filterType() { + return this.filterType; + } + + /** + * Set filter type that is evaluated against a BrokeredMessage. Possible values include: 'SqlFilter', 'CorrelationFilter'. + * + * @param filterType the filterType value to set + * @return the RuleInner object itself. + */ + public RuleInner withFilterType(FilterType filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get properties of sqlFilter. + * + * @return the sqlFilter value + */ + public SqlFilter sqlFilter() { + return this.sqlFilter; + } + + /** + * Set properties of sqlFilter. + * + * @param sqlFilter the sqlFilter value to set + * @return the RuleInner object itself. + */ + public RuleInner withSqlFilter(SqlFilter sqlFilter) { + this.sqlFilter = sqlFilter; + return this; + } + + /** + * Get properties of correlationFilter. + * + * @return the correlationFilter value + */ + public CorrelationFilter correlationFilter() { + return this.correlationFilter; + } + + /** + * Set properties of correlationFilter. + * + * @param correlationFilter the correlationFilter value to set + * @return the RuleInner object itself. + */ + public RuleInner withCorrelationFilter(CorrelationFilter correlationFilter) { + this.correlationFilter = correlationFilter; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesImpl.java new file mode 100644 index 000000000000..df0a3832b736 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rule; + +class RulesImpl extends WrapperImpl implements Rules { + private final ServiceBusManager manager; + + RulesImpl(ServiceBusManager manager) { + super(manager.inner().rules()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public RuleImpl define(String name) { + return wrapModel(name); + } + + private RuleImpl wrapModel(RuleInner inner) { + return new RuleImpl(inner, manager()); + } + + private RuleImpl wrapModel(String name) { + return new RuleImpl(name, this.manager()); + } + + @Override + public Observable listBySubscriptionsAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName) { + RulesInner client = this.inner(); + return client.listBySubscriptionsAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Rule call(RuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + RulesInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) + .flatMap(new Func1>() { + @Override + public Observable call(RuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Rule)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + RulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).toCompletable(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesInner.java new file mode 100644 index 000000000000..40037ed9bcf2 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/RulesInner.java @@ -0,0 +1,799 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Rules. + */ +public class RulesInner { + /** The Retrofit service to perform REST calls. */ + private RulesService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of RulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RulesInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(RulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Rules to be + * used by Retrofit to perform actually REST calls. + */ + interface RulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rules listBySubscriptions" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules") + Observable> listBySubscriptions(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @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.servicebus.v2018_01_01_preview.Rules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RuleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rules listBySubscriptionsNext" }) + @GET + Observable> listBySubscriptionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuleInner> object if successful. + */ + public PagedList listBySubscriptions(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName) { + ServiceResponse> response = listBySubscriptionsSinglePageAsync(resourceGroupName, namespaceName, topicName, subscriptionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription 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> listBySubscriptionsAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySubscriptionsSinglePageAsync(resourceGroupName, namespaceName, topicName, subscriptionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuleInner> object + */ + public Observable> listBySubscriptionsAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName) { + return listBySubscriptionsWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuleInner> object + */ + public Observable>> listBySubscriptionsWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName) { + return listBySubscriptionsSinglePageAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .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(listBySubscriptionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySubscriptionsSinglePageAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final Integer skip = null; + final Integer top = null; + return service.listBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySubscriptionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuleInner> object if successful. + */ + public PagedList listBySubscriptions(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName, final Integer skip, final Integer top) { + ServiceResponse> response = listBySubscriptionsSinglePageAsync(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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> listBySubscriptionsAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySubscriptionsSinglePageAsync(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuleInner> object + */ + public Observable> listBySubscriptionsAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName, final Integer skip, final Integer top) { + return listBySubscriptionsWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuleInner> object + */ + public Observable>> listBySubscriptionsWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName, final Integer skip, final Integer top) { + return listBySubscriptionsSinglePageAsync(resourceGroupName, namespaceName, topicName, subscriptionName, skip, 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(listBySubscriptionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the rules within given topic-subscription. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param topicName The topic name. + ServiceResponse> * @param subscriptionName The subscription name. + ServiceResponse> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySubscriptionsSinglePageAsync(final String resourceGroupName, final String namespaceName, final String topicName, final String subscriptionName, final Integer skip, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySubscriptionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySubscriptionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuleInner object if successful. + */ + public RuleInner createOrUpdate(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName, RuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @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 namespaceName, String topicName, String subscriptionName, String ruleName, RuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters), serviceCallback); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuleInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName, RuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters).map(new Func1, RuleInner>() { + @Override + public RuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuleInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName, RuleInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).toBlocking().single().body(); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule 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 deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName), serviceCallback); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuleInner object if successful. + */ + public RuleInner get(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).toBlocking().single().body(); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule 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 getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName), serviceCallback); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuleInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).map(new Func1, RuleInner>() { + @Override + public RuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List all the rules within given topic-subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuleInner> object if successful. + */ + public PagedList listBySubscriptionsNext(final String nextPageLink) { + ServiceResponse> response = listBySubscriptionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the rules within given topic-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> listBySubscriptionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySubscriptionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the rules within given topic-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<RuleInner> object + */ + public Observable> listBySubscriptionsNextAsync(final String nextPageLink) { + return listBySubscriptionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the rules within given topic-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<RuleInner> object + */ + public Observable>> listBySubscriptionsNextWithServiceResponseAsync(final String nextPageLink) { + return listBySubscriptionsNextSinglePageAsync(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(listBySubscriptionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the rules within given topic-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<RuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySubscriptionsNextSinglePageAsync(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.listBySubscriptionsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySubscriptionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySubscriptionsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBAuthorizationRuleInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBAuthorizationRuleInner.java new file mode 100644 index 000000000000..2930ce9c5724 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBAuthorizationRuleInner.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.servicebus.v2018_01_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of a namespace authorization rule. + */ +@JsonFlatten +public class SBAuthorizationRuleInner extends ProxyResource { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights", required = true) + private List rights; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the SBAuthorizationRuleInner object itself. + */ + public SBAuthorizationRuleInner withRights(List rights) { + this.rights = rights; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceImpl.java index aebce3c181d6..1358613169b8 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceImpl.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceImpl.java @@ -14,6 +14,8 @@ import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBNamespaceUpdateParameters; import org.joda.time.DateTime; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBSku; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Identity; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Encryption; import rx.functions.Func1; class SBNamespaceImpl extends GroupableResourceCoreImpl implements SBNamespace, SBNamespace.Definition, SBNamespace.Update { @@ -71,6 +73,16 @@ public DateTime createdAt() { return this.inner().createdAt(); } + @Override + public Encryption encryption() { + return this.inner().encryption(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + @Override public String metricId() { return this.inner().metricId(); @@ -101,6 +113,26 @@ public Boolean zoneRedundant() { return this.inner().zoneRedundant(); } + @Override + public SBNamespaceImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.inner().withEncryption(encryption); + } else { + this.updateParameter.withEncryption(encryption); + } + return this; + } + + @Override + public SBNamespaceImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + @Override public SBNamespaceImpl withSku(SBSku sku) { if (isInCreateMode()) { diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceInner.java index 42e5f6c45cde..76bf0119de7f 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceInner.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBNamespaceInner.java @@ -9,7 +9,9 @@ package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBSku; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Identity; import org.joda.time.DateTime; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Encryption; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -25,6 +27,12 @@ public class SBNamespaceInner extends Resource { @JsonProperty(value = "sku") private SBSku sku; + /** + * Properties of BYOK Identity description. + */ + @JsonProperty(value = "identity") + private Identity identity; + /** * Provisioning state of the namespace. */ @@ -62,6 +70,12 @@ public class SBNamespaceInner extends Resource { @JsonProperty(value = "properties.zoneRedundant") private Boolean zoneRedundant; + /** + * Properties of BYOK Encryption description. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + /** * Get properties of SKU. * @@ -82,6 +96,26 @@ public SBNamespaceInner withSku(SBSku sku) { return this; } + /** + * Get properties of BYOK Identity description. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set properties of BYOK Identity description. + * + * @param identity the identity value to set + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + /** * Get provisioning state of the namespace. * @@ -147,4 +181,24 @@ public SBNamespaceInner withZoneRedundant(Boolean zoneRedundant) { return this; } + /** + * Get properties of BYOK Encryption description. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set properties of BYOK Encryption description. + * + * @param encryption the encryption value to set + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueImpl.java new file mode 100644 index 000000000000..005713c8a2f9 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueImpl.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBQueue; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MessageCountDetails; +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; + +class SBQueueImpl extends CreatableUpdatableImpl implements SBQueue, SBQueue.Definition, SBQueue.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String queueName; + + SBQueueImpl(String name, ServiceBusManager manager) { + super(name, new SBQueueInner()); + this.manager = manager; + // Set resource name + this.queueName = name; + // + } + + SBQueueImpl(SBQueueInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.queueName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.queueName = IdParsingUtils.getValueFromIdByName(inner.id(), "queues"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.queueName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.queueName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.queueName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime accessedAt() { + return this.inner().accessedAt(); + } + + @Override + public Period autoDeleteOnIdle() { + return this.inner().autoDeleteOnIdle(); + } + + @Override + public MessageCountDetails countDetails() { + return this.inner().countDetails(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Boolean deadLetteringOnMessageExpiration() { + return this.inner().deadLetteringOnMessageExpiration(); + } + + @Override + public Period defaultMessageTimeToLive() { + return this.inner().defaultMessageTimeToLive(); + } + + @Override + public Period duplicateDetectionHistoryTimeWindow() { + return this.inner().duplicateDetectionHistoryTimeWindow(); + } + + @Override + public Boolean enableBatchedOperations() { + return this.inner().enableBatchedOperations(); + } + + @Override + public Boolean enableExpress() { + return this.inner().enableExpress(); + } + + @Override + public Boolean enablePartitioning() { + return this.inner().enablePartitioning(); + } + + @Override + public String forwardDeadLetteredMessagesTo() { + return this.inner().forwardDeadLetteredMessagesTo(); + } + + @Override + public String forwardTo() { + return this.inner().forwardTo(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Period lockDuration() { + return this.inner().lockDuration(); + } + + @Override + public Integer maxDeliveryCount() { + return this.inner().maxDeliveryCount(); + } + + @Override + public Integer maxSizeInMegabytes() { + return this.inner().maxSizeInMegabytes(); + } + + @Override + public Long messageCount() { + return this.inner().messageCount(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean requiresDuplicateDetection() { + return this.inner().requiresDuplicateDetection(); + } + + @Override + public Boolean requiresSession() { + return this.inner().requiresSession(); + } + + @Override + public Long sizeInBytes() { + return this.inner().sizeInBytes(); + } + + @Override + public EntityStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public SBQueueImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public SBQueueImpl withAutoDeleteOnIdle(Period autoDeleteOnIdle) { + this.inner().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + @Override + public SBQueueImpl withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.inner().withDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpiration); + return this; + } + + @Override + public SBQueueImpl withDefaultMessageTimeToLive(Period defaultMessageTimeToLive) { + this.inner().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + @Override + public SBQueueImpl withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow) { + this.inner().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + @Override + public SBQueueImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.inner().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + @Override + public SBQueueImpl withEnableExpress(Boolean enableExpress) { + this.inner().withEnableExpress(enableExpress); + return this; + } + + @Override + public SBQueueImpl withEnablePartitioning(Boolean enablePartitioning) { + this.inner().withEnablePartitioning(enablePartitioning); + return this; + } + + @Override + public SBQueueImpl withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.inner().withForwardDeadLetteredMessagesTo(forwardDeadLetteredMessagesTo); + return this; + } + + @Override + public SBQueueImpl withForwardTo(String forwardTo) { + this.inner().withForwardTo(forwardTo); + return this; + } + + @Override + public SBQueueImpl withLockDuration(Period lockDuration) { + this.inner().withLockDuration(lockDuration); + return this; + } + + @Override + public SBQueueImpl withMaxDeliveryCount(Integer maxDeliveryCount) { + this.inner().withMaxDeliveryCount(maxDeliveryCount); + return this; + } + + @Override + public SBQueueImpl withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.inner().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + @Override + public SBQueueImpl withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.inner().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + @Override + public SBQueueImpl withRequiresSession(Boolean requiresSession) { + this.inner().withRequiresSession(requiresSession); + return this; + } + + @Override + public SBQueueImpl withStatus(EntityStatus status) { + this.inner().withStatus(status); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueInner.java new file mode 100644 index 000000000000..dc8b1bff36e8 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBQueueInner.java @@ -0,0 +1,522 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MessageCountDetails; +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of queue Resource. + */ +@JsonFlatten +public class SBQueueInner extends ProxyResource { + /** + * Message Count Details. + */ + @JsonProperty(value = "properties.countDetails", access = JsonProperty.Access.WRITE_ONLY) + private MessageCountDetails countDetails; + + /** + * The exact time the message was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdAt; + + /** + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updatedAt; + + /** + * Last time a message was sent, or the last time there was a receive + * request to this queue. + */ + @JsonProperty(value = "properties.accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessedAt; + + /** + * The size of the queue, in bytes. + */ + @JsonProperty(value = "properties.sizeInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long sizeInBytes; + + /** + * The number of messages in the queue. + */ + @JsonProperty(value = "properties.messageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long messageCount; + + /** + * ISO 8601 timespan duration of a peek-lock; that is, the amount of time + * that the message is locked for other receivers. The maximum value for + * LockDuration is 5 minutes; the default value is 1 minute. + */ + @JsonProperty(value = "properties.lockDuration") + private Period lockDuration; + + /** + * The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + */ + @JsonProperty(value = "properties.maxSizeInMegabytes") + private Integer maxSizeInMegabytes; + + /** + * A value indicating if this queue requires duplicate detection. + */ + @JsonProperty(value = "properties.requiresDuplicateDetection") + private Boolean requiresDuplicateDetection; + + /** + * A value that indicates whether the queue supports the concept of + * sessions. + */ + @JsonProperty(value = "properties.requiresSession") + private Boolean requiresSession; + + /** + * ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent + * to Service Bus. This is the default value used when TimeToLive is not + * set on a message itself. + */ + @JsonProperty(value = "properties.defaultMessageTimeToLive") + private Period defaultMessageTimeToLive; + + /** + * A value that indicates whether this queue has dead letter support when a + * message expires. + */ + @JsonProperty(value = "properties.deadLetteringOnMessageExpiration") + private Boolean deadLetteringOnMessageExpiration; + + /** + * ISO 8601 timeSpan structure that defines the duration of the duplicate + * detection history. The default value is 10 minutes. + */ + @JsonProperty(value = "properties.duplicateDetectionHistoryTimeWindow") + private Period duplicateDetectionHistoryTimeWindow; + + /** + * The maximum delivery count. A message is automatically deadlettered + * after this number of deliveries. default value is 10. + */ + @JsonProperty(value = "properties.maxDeliveryCount") + private Integer maxDeliveryCount; + + /** + * Enumerates the possible values for the status of a messaging entity. + * Possible values include: 'Active', 'Disabled', 'Restoring', + * 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', + * 'Unknown'. + */ + @JsonProperty(value = "properties.status") + private EntityStatus status; + + /** + * Value that indicates whether server-side batched operations are enabled. + */ + @JsonProperty(value = "properties.enableBatchedOperations") + private Boolean enableBatchedOperations; + + /** + * ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + */ + @JsonProperty(value = "properties.autoDeleteOnIdle") + private Period autoDeleteOnIdle; + + /** + * A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + */ + @JsonProperty(value = "properties.enablePartitioning") + private Boolean enablePartitioning; + + /** + * A value that indicates whether Express Entities are enabled. An express + * queue holds a message in memory temporarily before writing it to + * persistent storage. + */ + @JsonProperty(value = "properties.enableExpress") + private Boolean enableExpress; + + /** + * Queue/Topic name to forward the messages. + */ + @JsonProperty(value = "properties.forwardTo") + private String forwardTo; + + /** + * Queue/Topic name to forward the Dead Letter message. + */ + @JsonProperty(value = "properties.forwardDeadLetteredMessagesTo") + private String forwardDeadLetteredMessagesTo; + + /** + * Get message Count Details. + * + * @return the countDetails value + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the exact time the message was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Get the exact time the message was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get last time a message was sent, or the last time there was a receive request to this queue. + * + * @return the accessedAt value + */ + public DateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the size of the queue, in bytes. + * + * @return the sizeInBytes value + */ + public Long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the number of messages in the queue. + * + * @return the messageCount value + */ + public Long messageCount() { + return this.messageCount; + } + + /** + * Get iSO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + * + * @return the lockDuration value + */ + public Period lockDuration() { + return this.lockDuration; + } + + /** + * Set iSO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + * + * @param lockDuration the lockDuration value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withLockDuration(Period lockDuration) { + this.lockDuration = lockDuration; + return this; + } + + /** + * Get the maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024. + * + * @return the maxSizeInMegabytes value + */ + public Integer maxSizeInMegabytes() { + return this.maxSizeInMegabytes; + } + + /** + * Set the maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024. + * + * @param maxSizeInMegabytes the maxSizeInMegabytes value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.maxSizeInMegabytes = maxSizeInMegabytes; + return this; + } + + /** + * Get a value indicating if this queue requires duplicate detection. + * + * @return the requiresDuplicateDetection value + */ + public Boolean requiresDuplicateDetection() { + return this.requiresDuplicateDetection; + } + + /** + * Set a value indicating if this queue requires duplicate detection. + * + * @param requiresDuplicateDetection the requiresDuplicateDetection value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.requiresDuplicateDetection = requiresDuplicateDetection; + return this; + } + + /** + * Get a value that indicates whether the queue supports the concept of sessions. + * + * @return the requiresSession value + */ + public Boolean requiresSession() { + return this.requiresSession; + } + + /** + * Set a value that indicates whether the queue supports the concept of sessions. + * + * @param requiresSession the requiresSession value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withRequiresSession(Boolean requiresSession) { + this.requiresSession = requiresSession; + return this; + } + + /** + * Get iSO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value + */ + public Period defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set iSO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withDefaultMessageTimeToLive(Period defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get a value that indicates whether this queue has dead letter support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value + */ + public Boolean deadLetteringOnMessageExpiration() { + return this.deadLetteringOnMessageExpiration; + } + + /** + * Set a value that indicates whether this queue has dead letter support when a message expires. + * + * @param deadLetteringOnMessageExpiration the deadLetteringOnMessageExpiration value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.deadLetteringOnMessageExpiration = deadLetteringOnMessageExpiration; + return this; + } + + /** + * Get iSO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value + */ + public Period duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set iSO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10. + * + * @return the maxDeliveryCount value + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10. + * + * @param maxDeliveryCount the maxDeliveryCount value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + + /** + * Get enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @return the status value + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @param status the status value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get value that indicates whether server-side batched operations are enabled. + * + * @return the enableBatchedOperations value + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set value that indicates whether server-side batched operations are enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.enableBatchedOperations = enableBatchedOperations; + return this; + } + + /** + * Get iSO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value + */ + public Period autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set iSO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withAutoDeleteOnIdle(Period autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get a value that indicates whether the queue is to be partitioned across multiple message brokers. + * + * @return the enablePartitioning value + */ + public Boolean enablePartitioning() { + return this.enablePartitioning; + } + + /** + * Set a value that indicates whether the queue is to be partitioned across multiple message brokers. + * + * @param enablePartitioning the enablePartitioning value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withEnablePartitioning(Boolean enablePartitioning) { + this.enablePartitioning = enablePartitioning; + return this; + } + + /** + * Get a value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value + */ + public Boolean enableExpress() { + return this.enableExpress; + } + + /** + * Set a value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage. + * + * @param enableExpress the enableExpress value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withEnableExpress(Boolean enableExpress) { + this.enableExpress = enableExpress; + return this; + } + + /** + * Get queue/Topic name to forward the messages. + * + * @return the forwardTo value + */ + public String forwardTo() { + return this.forwardTo; + } + + /** + * Set queue/Topic name to forward the messages. + * + * @param forwardTo the forwardTo value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withForwardTo(String forwardTo) { + this.forwardTo = forwardTo; + return this; + } + + /** + * Get queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value + */ + public String forwardDeadLetteredMessagesTo() { + return this.forwardDeadLetteredMessagesTo; + } + + /** + * Set queue/Topic name to forward the Dead Letter message. + * + * @param forwardDeadLetteredMessagesTo the forwardDeadLetteredMessagesTo value to set + * @return the SBQueueInner object itself. + */ + public SBQueueInner withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.forwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionImpl.java new file mode 100644 index 000000000000..71cebdd2b338 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionImpl.java @@ -0,0 +1,258 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBSubscription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MessageCountDetails; +import org.joda.time.Period; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; + +class SBSubscriptionImpl extends CreatableUpdatableImpl implements SBSubscription, SBSubscription.Definition, SBSubscription.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String topicName; + private String subscriptionName; + + SBSubscriptionImpl(String name, ServiceBusManager manager) { + super(name, new SBSubscriptionInner()); + this.manager = manager; + // Set resource name + this.subscriptionName = name; + // + } + + SBSubscriptionImpl(SBSubscriptionInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.subscriptionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.topicName = IdParsingUtils.getValueFromIdByName(inner.id(), "topics"); + this.subscriptionName = IdParsingUtils.getValueFromIdByName(inner.id(), "subscriptions"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SubscriptionsInner client = this.manager().inner().subscriptions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.subscriptionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SubscriptionsInner client = this.manager().inner().subscriptions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.subscriptionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SubscriptionsInner client = this.manager().inner().subscriptions(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.subscriptionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime accessedAt() { + return this.inner().accessedAt(); + } + + @Override + public Period autoDeleteOnIdle() { + return this.inner().autoDeleteOnIdle(); + } + + @Override + public MessageCountDetails countDetails() { + return this.inner().countDetails(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Boolean deadLetteringOnFilterEvaluationExceptions() { + return this.inner().deadLetteringOnFilterEvaluationExceptions(); + } + + @Override + public Boolean deadLetteringOnMessageExpiration() { + return this.inner().deadLetteringOnMessageExpiration(); + } + + @Override + public Period defaultMessageTimeToLive() { + return this.inner().defaultMessageTimeToLive(); + } + + @Override + public Period duplicateDetectionHistoryTimeWindow() { + return this.inner().duplicateDetectionHistoryTimeWindow(); + } + + @Override + public Boolean enableBatchedOperations() { + return this.inner().enableBatchedOperations(); + } + + @Override + public String forwardDeadLetteredMessagesTo() { + return this.inner().forwardDeadLetteredMessagesTo(); + } + + @Override + public String forwardTo() { + return this.inner().forwardTo(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Period lockDuration() { + return this.inner().lockDuration(); + } + + @Override + public Integer maxDeliveryCount() { + return this.inner().maxDeliveryCount(); + } + + @Override + public Long messageCount() { + return this.inner().messageCount(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean requiresSession() { + return this.inner().requiresSession(); + } + + @Override + public EntityStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public SBSubscriptionImpl withExistingTopic(String resourceGroupName, String namespaceName, String topicName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.topicName = topicName; + return this; + } + + @Override + public SBSubscriptionImpl withAutoDeleteOnIdle(Period autoDeleteOnIdle) { + this.inner().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + @Override + public SBSubscriptionImpl withDeadLetteringOnFilterEvaluationExceptions(Boolean deadLetteringOnFilterEvaluationExceptions) { + this.inner().withDeadLetteringOnFilterEvaluationExceptions(deadLetteringOnFilterEvaluationExceptions); + return this; + } + + @Override + public SBSubscriptionImpl withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.inner().withDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpiration); + return this; + } + + @Override + public SBSubscriptionImpl withDefaultMessageTimeToLive(Period defaultMessageTimeToLive) { + this.inner().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + @Override + public SBSubscriptionImpl withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow) { + this.inner().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + @Override + public SBSubscriptionImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.inner().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + @Override + public SBSubscriptionImpl withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.inner().withForwardDeadLetteredMessagesTo(forwardDeadLetteredMessagesTo); + return this; + } + + @Override + public SBSubscriptionImpl withForwardTo(String forwardTo) { + this.inner().withForwardTo(forwardTo); + return this; + } + + @Override + public SBSubscriptionImpl withLockDuration(Period lockDuration) { + this.inner().withLockDuration(lockDuration); + return this; + } + + @Override + public SBSubscriptionImpl withMaxDeliveryCount(Integer maxDeliveryCount) { + this.inner().withMaxDeliveryCount(maxDeliveryCount); + return this; + } + + @Override + public SBSubscriptionImpl withRequiresSession(Boolean requiresSession) { + this.inner().withRequiresSession(requiresSession); + return this; + } + + @Override + public SBSubscriptionImpl withStatus(EntityStatus status) { + this.inner().withStatus(status); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionInner.java new file mode 100644 index 000000000000..9811e9a8d9e8 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBSubscriptionInner.java @@ -0,0 +1,422 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MessageCountDetails; +import org.joda.time.Period; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of subscription resource. + */ +@JsonFlatten +public class SBSubscriptionInner extends ProxyResource { + /** + * Number of messages. + */ + @JsonProperty(value = "properties.messageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long messageCount; + + /** + * Exact time the message was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdAt; + + /** + * Last time there was a receive request to this subscription. + */ + @JsonProperty(value = "properties.accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessedAt; + + /** + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updatedAt; + + /** + * Message count details. + */ + @JsonProperty(value = "properties.countDetails", access = JsonProperty.Access.WRITE_ONLY) + private MessageCountDetails countDetails; + + /** + * ISO 8061 lock duration timespan for the subscription. The default value + * is 1 minute. + */ + @JsonProperty(value = "properties.lockDuration") + private Period lockDuration; + + /** + * Value indicating if a subscription supports the concept of sessions. + */ + @JsonProperty(value = "properties.requiresSession") + private Boolean requiresSession; + + /** + * ISO 8061 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent + * to Service Bus. This is the default value used when TimeToLive is not + * set on a message itself. + */ + @JsonProperty(value = "properties.defaultMessageTimeToLive") + private Period defaultMessageTimeToLive; + + /** + * Value that indicates whether a subscription has dead letter support on + * filter evaluation exceptions. + */ + @JsonProperty(value = "properties.deadLetteringOnFilterEvaluationExceptions") + private Boolean deadLetteringOnFilterEvaluationExceptions; + + /** + * Value that indicates whether a subscription has dead letter support when + * a message expires. + */ + @JsonProperty(value = "properties.deadLetteringOnMessageExpiration") + private Boolean deadLetteringOnMessageExpiration; + + /** + * ISO 8601 timeSpan structure that defines the duration of the duplicate + * detection history. The default value is 10 minutes. + */ + @JsonProperty(value = "properties.duplicateDetectionHistoryTimeWindow") + private Period duplicateDetectionHistoryTimeWindow; + + /** + * Number of maximum deliveries. + */ + @JsonProperty(value = "properties.maxDeliveryCount") + private Integer maxDeliveryCount; + + /** + * Enumerates the possible values for the status of a messaging entity. + * Possible values include: 'Active', 'Disabled', 'Restoring', + * 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', + * 'Unknown'. + */ + @JsonProperty(value = "properties.status") + private EntityStatus status; + + /** + * Value that indicates whether server-side batched operations are enabled. + */ + @JsonProperty(value = "properties.enableBatchedOperations") + private Boolean enableBatchedOperations; + + /** + * ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + */ + @JsonProperty(value = "properties.autoDeleteOnIdle") + private Period autoDeleteOnIdle; + + /** + * Queue/Topic name to forward the messages. + */ + @JsonProperty(value = "properties.forwardTo") + private String forwardTo; + + /** + * Queue/Topic name to forward the Dead Letter message. + */ + @JsonProperty(value = "properties.forwardDeadLetteredMessagesTo") + private String forwardDeadLetteredMessagesTo; + + /** + * Get number of messages. + * + * @return the messageCount value + */ + public Long messageCount() { + return this.messageCount; + } + + /** + * Get exact time the message was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Get last time there was a receive request to this subscription. + * + * @return the accessedAt value + */ + public DateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the exact time the message was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get message count details. + * + * @return the countDetails value + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get iSO 8061 lock duration timespan for the subscription. The default value is 1 minute. + * + * @return the lockDuration value + */ + public Period lockDuration() { + return this.lockDuration; + } + + /** + * Set iSO 8061 lock duration timespan for the subscription. The default value is 1 minute. + * + * @param lockDuration the lockDuration value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withLockDuration(Period lockDuration) { + this.lockDuration = lockDuration; + return this; + } + + /** + * Get value indicating if a subscription supports the concept of sessions. + * + * @return the requiresSession value + */ + public Boolean requiresSession() { + return this.requiresSession; + } + + /** + * Set value indicating if a subscription supports the concept of sessions. + * + * @param requiresSession the requiresSession value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withRequiresSession(Boolean requiresSession) { + this.requiresSession = requiresSession; + return this; + } + + /** + * Get iSO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value + */ + public Period defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set iSO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDefaultMessageTimeToLive(Period defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get value that indicates whether a subscription has dead letter support on filter evaluation exceptions. + * + * @return the deadLetteringOnFilterEvaluationExceptions value + */ + public Boolean deadLetteringOnFilterEvaluationExceptions() { + return this.deadLetteringOnFilterEvaluationExceptions; + } + + /** + * Set value that indicates whether a subscription has dead letter support on filter evaluation exceptions. + * + * @param deadLetteringOnFilterEvaluationExceptions the deadLetteringOnFilterEvaluationExceptions value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDeadLetteringOnFilterEvaluationExceptions(Boolean deadLetteringOnFilterEvaluationExceptions) { + this.deadLetteringOnFilterEvaluationExceptions = deadLetteringOnFilterEvaluationExceptions; + return this; + } + + /** + * Get value that indicates whether a subscription has dead letter support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value + */ + public Boolean deadLetteringOnMessageExpiration() { + return this.deadLetteringOnMessageExpiration; + } + + /** + * Set value that indicates whether a subscription has dead letter support when a message expires. + * + * @param deadLetteringOnMessageExpiration the deadLetteringOnMessageExpiration value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.deadLetteringOnMessageExpiration = deadLetteringOnMessageExpiration; + return this; + } + + /** + * Get iSO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value + */ + public Period duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set iSO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get number of maximum deliveries. + * + * @return the maxDeliveryCount value + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set number of maximum deliveries. + * + * @param maxDeliveryCount the maxDeliveryCount value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + + /** + * Get enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @return the status value + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @param status the status value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get value that indicates whether server-side batched operations are enabled. + * + * @return the enableBatchedOperations value + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set value that indicates whether server-side batched operations are enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.enableBatchedOperations = enableBatchedOperations; + return this; + } + + /** + * Get iSO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value + */ + public Period autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set iSO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withAutoDeleteOnIdle(Period autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get queue/Topic name to forward the messages. + * + * @return the forwardTo value + */ + public String forwardTo() { + return this.forwardTo; + } + + /** + * Set queue/Topic name to forward the messages. + * + * @param forwardTo the forwardTo value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withForwardTo(String forwardTo) { + this.forwardTo = forwardTo; + return this; + } + + /** + * Get queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value + */ + public String forwardDeadLetteredMessagesTo() { + return this.forwardDeadLetteredMessagesTo; + } + + /** + * Set queue/Topic name to forward the Dead Letter message. + * + * @param forwardDeadLetteredMessagesTo the forwardDeadLetteredMessagesTo value to set + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.forwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicImpl.java new file mode 100644 index 000000000000..459c26da44bb --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBTopic; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MessageCountDetails; +import org.joda.time.Period; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; + +class SBTopicImpl extends CreatableUpdatableImpl implements SBTopic, SBTopic.Definition, SBTopic.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String topicName; + + SBTopicImpl(String name, ServiceBusManager manager) { + super(name, new SBTopicInner()); + this.manager = manager; + // Set resource name + this.topicName = name; + // + } + + SBTopicImpl(SBTopicInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.topicName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.topicName = IdParsingUtils.getValueFromIdByName(inner.id(), "topics"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.topicName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime accessedAt() { + return this.inner().accessedAt(); + } + + @Override + public Period autoDeleteOnIdle() { + return this.inner().autoDeleteOnIdle(); + } + + @Override + public MessageCountDetails countDetails() { + return this.inner().countDetails(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public Period defaultMessageTimeToLive() { + return this.inner().defaultMessageTimeToLive(); + } + + @Override + public Period duplicateDetectionHistoryTimeWindow() { + return this.inner().duplicateDetectionHistoryTimeWindow(); + } + + @Override + public Boolean enableBatchedOperations() { + return this.inner().enableBatchedOperations(); + } + + @Override + public Boolean enableExpress() { + return this.inner().enableExpress(); + } + + @Override + public Boolean enablePartitioning() { + return this.inner().enablePartitioning(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer maxSizeInMegabytes() { + return this.inner().maxSizeInMegabytes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean requiresDuplicateDetection() { + return this.inner().requiresDuplicateDetection(); + } + + @Override + public Long sizeInBytes() { + return this.inner().sizeInBytes(); + } + + @Override + public EntityStatus status() { + return this.inner().status(); + } + + @Override + public Integer subscriptionCount() { + return this.inner().subscriptionCount(); + } + + @Override + public Boolean supportOrdering() { + return this.inner().supportOrdering(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public SBTopicImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public SBTopicImpl withAutoDeleteOnIdle(Period autoDeleteOnIdle) { + this.inner().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + @Override + public SBTopicImpl withDefaultMessageTimeToLive(Period defaultMessageTimeToLive) { + this.inner().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + @Override + public SBTopicImpl withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow) { + this.inner().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + @Override + public SBTopicImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.inner().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + @Override + public SBTopicImpl withEnableExpress(Boolean enableExpress) { + this.inner().withEnableExpress(enableExpress); + return this; + } + + @Override + public SBTopicImpl withEnablePartitioning(Boolean enablePartitioning) { + this.inner().withEnablePartitioning(enablePartitioning); + return this; + } + + @Override + public SBTopicImpl withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.inner().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + @Override + public SBTopicImpl withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.inner().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + @Override + public SBTopicImpl withStatus(EntityStatus status) { + this.inner().withStatus(status); + return this; + } + + @Override + public SBTopicImpl withSupportOrdering(Boolean supportOrdering) { + this.inner().withSupportOrdering(supportOrdering); + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicInner.java new file mode 100644 index 000000000000..4544d195c821 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SBTopicInner.java @@ -0,0 +1,387 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MessageCountDetails; +import org.joda.time.Period; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EntityStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of topic resource. + */ +@JsonFlatten +public class SBTopicInner extends ProxyResource { + /** + * Size of the topic, in bytes. + */ + @JsonProperty(value = "properties.sizeInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long sizeInBytes; + + /** + * Exact time the message was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdAt; + + /** + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updatedAt; + + /** + * Last time the message was sent, or a request was received, for this + * topic. + */ + @JsonProperty(value = "properties.accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessedAt; + + /** + * Number of subscriptions. + */ + @JsonProperty(value = "properties.subscriptionCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer subscriptionCount; + + /** + * Message count details. + */ + @JsonProperty(value = "properties.countDetails", access = JsonProperty.Access.WRITE_ONLY) + private MessageCountDetails countDetails; + + /** + * ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent + * to Service Bus. This is the default value used when TimeToLive is not + * set on a message itself. + */ + @JsonProperty(value = "properties.defaultMessageTimeToLive") + private Period defaultMessageTimeToLive; + + /** + * Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + */ + @JsonProperty(value = "properties.maxSizeInMegabytes") + private Integer maxSizeInMegabytes; + + /** + * Value indicating if this topic requires duplicate detection. + */ + @JsonProperty(value = "properties.requiresDuplicateDetection") + private Boolean requiresDuplicateDetection; + + /** + * ISO8601 timespan structure that defines the duration of the duplicate + * detection history. The default value is 10 minutes. + */ + @JsonProperty(value = "properties.duplicateDetectionHistoryTimeWindow") + private Period duplicateDetectionHistoryTimeWindow; + + /** + * Value that indicates whether server-side batched operations are enabled. + */ + @JsonProperty(value = "properties.enableBatchedOperations") + private Boolean enableBatchedOperations; + + /** + * Enumerates the possible values for the status of a messaging entity. + * Possible values include: 'Active', 'Disabled', 'Restoring', + * 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', + * 'Unknown'. + */ + @JsonProperty(value = "properties.status") + private EntityStatus status; + + /** + * Value that indicates whether the topic supports ordering. + */ + @JsonProperty(value = "properties.supportOrdering") + private Boolean supportOrdering; + + /** + * ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + */ + @JsonProperty(value = "properties.autoDeleteOnIdle") + private Period autoDeleteOnIdle; + + /** + * Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + */ + @JsonProperty(value = "properties.enablePartitioning") + private Boolean enablePartitioning; + + /** + * Value that indicates whether Express Entities are enabled. An express + * topic holds a message in memory temporarily before writing it to + * persistent storage. + */ + @JsonProperty(value = "properties.enableExpress") + private Boolean enableExpress; + + /** + * Get size of the topic, in bytes. + * + * @return the sizeInBytes value + */ + public Long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get exact time the message was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Get the exact time the message was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get last time the message was sent, or a request was received, for this topic. + * + * @return the accessedAt value + */ + public DateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get number of subscriptions. + * + * @return the subscriptionCount value + */ + public Integer subscriptionCount() { + return this.subscriptionCount; + } + + /** + * Get message count details. + * + * @return the countDetails value + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get iSO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value + */ + public Period defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set iSO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withDefaultMessageTimeToLive(Period defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024. + * + * @return the maxSizeInMegabytes value + */ + public Integer maxSizeInMegabytes() { + return this.maxSizeInMegabytes; + } + + /** + * Set maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024. + * + * @param maxSizeInMegabytes the maxSizeInMegabytes value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.maxSizeInMegabytes = maxSizeInMegabytes; + return this; + } + + /** + * Get value indicating if this topic requires duplicate detection. + * + * @return the requiresDuplicateDetection value + */ + public Boolean requiresDuplicateDetection() { + return this.requiresDuplicateDetection; + } + + /** + * Set value indicating if this topic requires duplicate detection. + * + * @param requiresDuplicateDetection the requiresDuplicateDetection value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.requiresDuplicateDetection = requiresDuplicateDetection; + return this; + } + + /** + * Get iSO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value + */ + public Period duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set iSO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get value that indicates whether server-side batched operations are enabled. + * + * @return the enableBatchedOperations value + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set value that indicates whether server-side batched operations are enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.enableBatchedOperations = enableBatchedOperations; + return this; + } + + /** + * Get enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @return the status value + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @param status the status value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get value that indicates whether the topic supports ordering. + * + * @return the supportOrdering value + */ + public Boolean supportOrdering() { + return this.supportOrdering; + } + + /** + * Set value that indicates whether the topic supports ordering. + * + * @param supportOrdering the supportOrdering value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withSupportOrdering(Boolean supportOrdering) { + this.supportOrdering = supportOrdering; + return this; + } + + /** + * Get iSO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value + */ + public Period autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set iSO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withAutoDeleteOnIdle(Period autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + * + * @return the enablePartitioning value + */ + public Boolean enablePartitioning() { + return this.enablePartitioning; + } + + /** + * Set value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + * + * @param enablePartitioning the enablePartitioning value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withEnablePartitioning(Boolean enablePartitioning) { + this.enablePartitioning = enablePartitioning; + return this; + } + + /** + * Get value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value + */ + public Boolean enableExpress() { + return this.enableExpress; + } + + /** + * Set value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. + * + * @param enableExpress the enableExpress value to set + * @return the SBTopicInner object itself. + */ + public SBTopicInner withEnableExpress(Boolean enableExpress) { + this.enableExpress = enableExpress; + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManagementClientImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManagementClientImpl.java index b97530bd1e45..4a6439a9962f 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManagementClientImpl.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManagementClientImpl.java @@ -51,18 +51,6 @@ public ServiceBusManagementClientImpl withSubscriptionId(String subscriptionId) return this; } - /** Client API version. */ - private String apiVersion; - - /** - * Gets Client API version. - * - * @return the apiVersion value. - */ - public String apiVersion() { - return this.apiVersion; - } - /** The preferred language for the response. */ private String acceptLanguage; @@ -132,6 +120,45 @@ public ServiceBusManagementClientImpl withGenerateClientRequestId(boolean genera return this; } + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + /** * The OperationsInner object to access its operations. */ @@ -146,16 +173,120 @@ public OperationsInner operations() { } /** - * The NamespacesInner object to access its operations. + * The QueuesInner object to access its operations. */ - private NamespacesInner namespaces; + private QueuesInner queues; /** - * Gets the NamespacesInner object to access its operations. - * @return the NamespacesInner object. + * Gets the QueuesInner object to access its operations. + * @return the QueuesInner object. */ - public NamespacesInner namespaces() { - return this.namespaces; + public QueuesInner queues() { + return this.queues; + } + + /** + * 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 DisasterRecoveryConfigsInner object to access its operations. + */ + private DisasterRecoveryConfigsInner disasterRecoveryConfigs; + + /** + * Gets the DisasterRecoveryConfigsInner object to access its operations. + * @return the DisasterRecoveryConfigsInner object. + */ + public DisasterRecoveryConfigsInner disasterRecoveryConfigs() { + return this.disasterRecoveryConfigs; + } + + /** + * The EventHubsInner object to access its operations. + */ + private EventHubsInner eventHubs; + + /** + * Gets the EventHubsInner object to access its operations. + * @return the EventHubsInner object. + */ + public EventHubsInner eventHubs() { + return this.eventHubs; + } + + /** + * The MigrationConfigsInner object to access its operations. + */ + private MigrationConfigsInner migrationConfigs; + + /** + * Gets the MigrationConfigsInner object to access its operations. + * @return the MigrationConfigsInner object. + */ + public MigrationConfigsInner migrationConfigs() { + return this.migrationConfigs; + } + + /** + * The PremiumMessagingRegionsInner object to access its operations. + */ + private PremiumMessagingRegionsInner premiumMessagingRegions; + + /** + * Gets the PremiumMessagingRegionsInner object to access its operations. + * @return the PremiumMessagingRegionsInner object. + */ + public PremiumMessagingRegionsInner premiumMessagingRegions() { + return this.premiumMessagingRegions; + } + + /** + * The RegionsInner object to access its operations. + */ + private RegionsInner regions; + + /** + * Gets the RegionsInner object to access its operations. + * @return the RegionsInner object. + */ + public RegionsInner regions() { + return this.regions; + } + + /** + * The SubscriptionsInner object to access its operations. + */ + private SubscriptionsInner subscriptions; + + /** + * Gets the SubscriptionsInner object to access its operations. + * @return the SubscriptionsInner object. + */ + public SubscriptionsInner subscriptions() { + return this.subscriptions; + } + + /** + * The RulesInner object to access its operations. + */ + private RulesInner rules; + + /** + * Gets the RulesInner object to access its operations. + * @return the RulesInner object. + */ + public RulesInner rules() { + return this.rules; } /** @@ -189,12 +320,22 @@ public ServiceBusManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2018-01-01-preview"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; - this.operations = new OperationsInner(restClient().retrofit(), this); this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.queues = new QueuesInner(restClient().retrofit(), this); + this.topics = new TopicsInner(restClient().retrofit(), this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsInner(restClient().retrofit(), this); + this.eventHubs = new EventHubsInner(restClient().retrofit(), this); + this.migrationConfigs = new MigrationConfigsInner(restClient().retrofit(), this); + this.premiumMessagingRegions = new PremiumMessagingRegionsInner(restClient().retrofit(), this); + this.regions = new RegionsInner(restClient().retrofit(), this); + this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this); + this.rules = new RulesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -205,6 +346,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ServiceBusManagementClient", "2018-01-01-preview"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ServiceBusManagementClient", "2018-01-01-preiew"); } } diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManager.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManager.java index 4bab908555a7..02c7f7abdb6b 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManager.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/ServiceBusManager.java @@ -16,8 +16,19 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; -import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Operations; import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Namespaces; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateEndpointConnections; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PrivateLinkResources; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Operations; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Queues; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.DisasterRecoveryConfigs; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.EventHubs; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.MigrationConfigs; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.PremiumMessagingRegions; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Regions; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Subscriptions; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Rules; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -25,8 +36,19 @@ * Entry point to Azure ServiceBus resource management. */ public final class ServiceBusManager extends ManagerCore { - private Operations operations; private Namespaces namespaces; + private PrivateEndpointConnections privateEndpointConnections; + private PrivateLinkResources privateLinkResources; + private Operations operations; + private Queues queues; + private Topics topics; + private DisasterRecoveryConfigs disasterRecoveryConfigs; + private EventHubs eventHubs; + private MigrationConfigs migrationConfigs; + private PremiumMessagingRegions premiumMessagingRegions; + private Regions regions; + private Subscriptions subscriptions; + private Rules rules; /** * Get a Configurable instance that can be used to create ServiceBusManager with optional configuration. * @@ -74,6 +96,36 @@ public interface Configurable extends AzureConfigurable { ServiceBusManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + /** * @return Entry point to manage Operations. */ @@ -85,13 +137,93 @@ public Operations operations() { } /** - * @return Entry point to manage Namespaces. + * @return Entry point to manage Queues. */ - public Namespaces namespaces() { - if (this.namespaces == null) { - this.namespaces = new NamespacesImpl(this); + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(this); } - return this.namespaces; + return this.queues; + } + + /** + * @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 DisasterRecoveryConfigs. + */ + public DisasterRecoveryConfigs disasterRecoveryConfigs() { + if (this.disasterRecoveryConfigs == null) { + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsImpl(this); + } + return this.disasterRecoveryConfigs; + } + + /** + * @return Entry point to manage EventHubs. + */ + public EventHubs eventHubs() { + if (this.eventHubs == null) { + this.eventHubs = new EventHubsImpl(this); + } + return this.eventHubs; + } + + /** + * @return Entry point to manage MigrationConfigs. + */ + public MigrationConfigs migrationConfigs() { + if (this.migrationConfigs == null) { + this.migrationConfigs = new MigrationConfigsImpl(this); + } + return this.migrationConfigs; + } + + /** + * @return Entry point to manage PremiumMessagingRegions. + */ + public PremiumMessagingRegions premiumMessagingRegions() { + if (this.premiumMessagingRegions == null) { + this.premiumMessagingRegions = new PremiumMessagingRegionsImpl(this); + } + return this.premiumMessagingRegions; + } + + /** + * @return Entry point to manage Regions. + */ + public Regions regions() { + if (this.regions == null) { + this.regions = new RegionsImpl(this); + } + return this.regions; + } + + /** + * @return Entry point to manage Subscriptions. + */ + public Subscriptions subscriptions() { + if (this.subscriptions == null) { + this.subscriptions = new SubscriptionsImpl(this); + } + return this.subscriptions; + } + + /** + * @return Entry point to manage Rules. + */ + public Rules rules() { + if (this.rules == null) { + this.rules = new RulesImpl(this); + } + return this.rules; } /** diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsImpl.java new file mode 100644 index 000000000000..15db80bfe07d --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Subscriptions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBSubscription; + +class SubscriptionsImpl extends WrapperImpl implements Subscriptions { + private final ServiceBusManager manager; + + SubscriptionsImpl(ServiceBusManager manager) { + super(manager.inner().subscriptions()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public SBSubscriptionImpl define(String name) { + return wrapModel(name); + } + + private SBSubscriptionImpl wrapModel(SBSubscriptionInner inner) { + return new SBSubscriptionImpl(inner, manager()); + } + + private SBSubscriptionImpl wrapModel(String name) { + return new SBSubscriptionImpl(name, this.manager()); + } + + @Override + public Observable listByTopicAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + SubscriptionsInner client = this.inner(); + return client.listByTopicAsync(resourceGroupName, namespaceName, topicName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SBSubscription call(SBSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + SubscriptionsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .flatMap(new Func1>() { + @Override + public Observable call(SBSubscriptionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SBSubscription)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + SubscriptionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, topicName, subscriptionName).toCompletable(); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsInner.java new file mode 100644 index 000000000000..75dc436aa62e --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/SubscriptionsInner.java @@ -0,0 +1,762 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Subscriptions. + */ +public class SubscriptionsInner { + /** The Retrofit service to perform REST calls. */ + private SubscriptionsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of SubscriptionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubscriptionsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { + this.service = retrofit.create(SubscriptionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Subscriptions to be + * used by Retrofit to perform actually REST calls. + */ + interface SubscriptionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Subscriptions listByTopic" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions") + Observable> listByTopic(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @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.servicebus.v2018_01_01_preview.Subscriptions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("subscriptionId") String subscriptionId, @Body SBSubscriptionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Subscriptions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Subscriptions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionName") String subscriptionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Subscriptions listByTopicNext" }) + @GET + Observable> listByTopicNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBSubscriptionInner> object if successful. + */ + public PagedList listByTopic(final String resourceGroupName, final String namespaceName, final String topicName) { + ServiceResponse> response = listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic 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> listByTopicAsync(final String resourceGroupName, final String namespaceName, final String topicName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBSubscriptionInner> object + */ + public Observable> listByTopicAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + return listByTopicWithServiceResponseAsync(resourceGroupName, namespaceName, topicName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBSubscriptionInner> object + */ + public Observable>> listByTopicWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + return listByTopicSinglePageAsync(resourceGroupName, namespaceName, 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(listByTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByTopicSinglePageAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final Integer skip = null; + final Integer top = null; + return service.listByTopic(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBSubscriptionInner> object if successful. + */ + public PagedList listByTopic(final String resourceGroupName, final String namespaceName, final String topicName, final Integer skip, final Integer top) { + ServiceResponse> response = listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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> listByTopicAsync(final String resourceGroupName, final String namespaceName, final String topicName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBSubscriptionInner> object + */ + public Observable> listByTopicAsync(final String resourceGroupName, final String namespaceName, final String topicName, final Integer skip, final Integer top) { + return listByTopicWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBSubscriptionInner> object + */ + public Observable>> listByTopicWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName, final Integer skip, final Integer top) { + return listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, 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(listByTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the subscriptions under a specified topic. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param topicName The topic name. + ServiceResponse> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByTopicSinglePageAsync(final String resourceGroupName, final String namespaceName, final String topicName, final Integer skip, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listByTopic(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByTopicDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBSubscriptionInner object if successful. + */ + public SBSubscriptionInner createOrUpdate(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, SBSubscriptionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, parameters).toBlocking().single().body(); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription 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 createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, SBSubscriptionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, parameters), serviceCallback); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBSubscriptionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, SBSubscriptionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, parameters).map(new Func1, SBSubscriptionInner>() { + @Override + public SBSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBSubscriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, SBSubscriptionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, topicName, subscriptionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName).toBlocking().single().body(); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription 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 deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName), serviceCallback); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, topicName, subscriptionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBSubscriptionInner object if successful. + */ + public SBSubscriptionInner get(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName).toBlocking().single().body(); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription 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 getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName), serviceCallback); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBSubscriptionInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName).map(new Func1, SBSubscriptionInner>() { + @Override + public SBSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBSubscriptionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (subscriptionName == null) { + throw new IllegalArgumentException("Parameter subscriptionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, topicName, subscriptionName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBSubscriptionInner> object if successful. + */ + public PagedList listByTopicNext(final String nextPageLink) { + ServiceResponse> response = listByTopicNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the subscriptions under a specified 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> listByTopicNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByTopicNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the subscriptions under a specified 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<SBSubscriptionInner> object + */ + public Observable> listByTopicNextAsync(final String nextPageLink) { + return listByTopicNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the subscriptions under a specified 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<SBSubscriptionInner> object + */ + public Observable>> listByTopicNextWithServiceResponseAsync(final String nextPageLink) { + return listByTopicNextSinglePageAsync(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(listByTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the subscriptions under a specified 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<SBSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByTopicNextSinglePageAsync(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.listByTopicNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByTopicNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByTopicNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicNamespaceSBAuthorizationRuleImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicNamespaceSBAuthorizationRuleImpl.java new file mode 100644 index 000000000000..b7ffbd33875d --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicNamespaceSBAuthorizationRuleImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.TopicNamespaceSBAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; + +class TopicNamespaceSBAuthorizationRuleImpl extends CreatableUpdatableImpl implements TopicNamespaceSBAuthorizationRule, TopicNamespaceSBAuthorizationRule.Definition, TopicNamespaceSBAuthorizationRule.Update { + private final ServiceBusManager manager; + private String resourceGroupName; + private String namespaceName; + private String topicName; + private String authorizationRuleName; + private List crights; + private List urights; + + TopicNamespaceSBAuthorizationRuleImpl(String name, ServiceBusManager manager) { + super(name, new SBAuthorizationRuleInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + } + + TopicNamespaceSBAuthorizationRuleImpl(SBAuthorizationRuleInner inner, ServiceBusManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.topicName = IdParsingUtils.getValueFromIdByName(inner.id(), "topics"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizationRules"); + // + } + + @Override + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.authorizationRuleName, this.crights) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.authorizationRuleName, this.urights) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TopicsInner client = this.manager().inner().topics(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.topicName, this.authorizationRuleName); + } + + @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 List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TopicNamespaceSBAuthorizationRuleImpl withExistingTopic(String resourceGroupName, String namespaceName, String topicName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.topicName = topicName; + return this; + } + + @Override + public TopicNamespaceSBAuthorizationRuleImpl withRights(List rights) { + if (isInCreateMode()) { + this.crights = rights; + } else { + this.urights = rights; + } + return this; + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsImpl.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsImpl.java new file mode 100644 index 000000000000..ce011129d8a4 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.SBTopic; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.TopicNamespaceSBAuthorizationRule; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RegenerateAccessKeyParameters; + +class TopicsImpl extends WrapperImpl implements Topics { + private final ServiceBusManager manager; + + TopicsImpl(ServiceBusManager manager) { + super(manager.inner().topics()); + this.manager = manager; + } + + public ServiceBusManager manager() { + return this.manager; + } + + @Override + public SBTopicImpl define(String name) { + return wrapModel(name); + } + + private SBTopicImpl wrapModel(SBTopicInner inner) { + return new SBTopicImpl(inner, manager()); + } + + private SBTopicImpl wrapModel(String name) { + return new SBTopicImpl(name, this.manager()); + } + + @Override + public Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + TopicsInner client = this.inner(); + return client.listByNamespaceAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SBTopic call(SBTopicInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName) { + TopicsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, topicName) + .flatMap(new Func1>() { + @Override + public Observable call(SBTopicInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SBTopic)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String topicName) { + TopicsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, topicName).toCompletable(); + } + + @Override + public TopicNamespaceSBAuthorizationRuleImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private TopicNamespaceSBAuthorizationRuleImpl wrapAuthorizationRuleModel(String name) { + return new TopicNamespaceSBAuthorizationRuleImpl(name, this.manager()); + } + + private TopicNamespaceSBAuthorizationRuleImpl wrapTopicNamespaceSBAuthorizationRuleModel(SBAuthorizationRuleInner inner) { + return new TopicNamespaceSBAuthorizationRuleImpl(inner, manager()); + } + + private Observable getSBAuthorizationRuleInnerUsingTopicsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String topicName = IdParsingUtils.getValueFromIdByName(id, "topics"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules"); + TopicsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + TopicsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap(new Func1>() { + @Override + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TopicNamespaceSBAuthorizationRule)wrapTopicNamespaceSBAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + TopicsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public TopicNamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { + return wrapTopicNamespaceSBAuthorizationRuleModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + TopicsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + TopicsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + TopicsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsInner.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsInner.java new file mode 100644 index 000000000000..35fc3648e8a4 --- /dev/null +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/TopicsInner.java @@ -0,0 +1,1504 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.AccessRights; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.management.servicebus.v2018_01_01_preview.RegenerateAccessKeyParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 { + /** The Retrofit service to perform REST calls. */ + private TopicsService service; + /** The service client containing this operation class. */ + private ServiceBusManagementClientImpl 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, ServiceBusManagementClientImpl 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.servicebus.v2018_01_01_preview.Topics listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SBAuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics") + Observable> listByNamespace(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @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.servicebus.v2018_01_01_preview.Topics createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Body SBTopicInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2018_01_01_preview.Topics listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@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.servicebus.v2018_01_01_preview.Topics listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String topicName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic 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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, topicName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBAuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, 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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets authorization rules for a topic. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String topicName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBAuthorizationRuleInner object if successful. + */ + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).toBlocking().single().body(); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights), serviceCallback); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); + } + Validator.validate(rights); + final String apiVersion = "2017-04-01"; + SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBAuthorizationRuleInner object if successful. + */ + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBAuthorizationRuleInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule 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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule 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 listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.regenerateKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBTopicInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace 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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBTopicInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBTopicInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName) + .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final Integer skip = null; + final Integer top = null; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBTopicInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBTopicInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBTopicInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, 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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the topics in a namespace. + * + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. + ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBTopicInner object if successful. + */ + public SBTopicInner createOrUpdate(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).toBlocking().single().body(); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic 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 createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters), serviceCallback); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBTopicInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).map(new Func1, SBTopicInner>() { + @Override + public SBTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBTopicInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String topicName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body(); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic 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 deleteAsync(String resourceGroupName, String namespaceName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String topicName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SBTopicInner object if successful. + */ + public SBTopicInner get(String resourceGroupName, String namespaceName, String topicName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body(); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic 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 getAsync(String resourceGroupName, String namespaceName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBTopicInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1, SBTopicInner>() { + @Override + public SBTopicInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SBTopicInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (topicName == null) { + throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets authorization rules for a topic. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBAuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets authorization rules for a 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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets authorization rules for a 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<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets authorization rules for a 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<SBAuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets authorization rules for a 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<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the topics in a namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SBTopicInner> object if successful. + */ + public PagedList listByNamespaceNext(final String nextPageLink) { + ServiceResponse> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the topics in a namespace. + * + * @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> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the topics in a namespace. + * + * @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<SBTopicInner> object + */ + public Observable> listByNamespaceNextAsync(final String nextPageLink) { + return listByNamespaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the topics in a namespace. + * + * @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<SBTopicInner> object + */ + public Observable>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByNamespaceNextSinglePageAsync(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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the topics in a namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceNextSinglePageAsync(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.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/package-info.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/package-info.java index 2c74456deed8..058c133a9be4 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/package-info.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/implementation/package-info.java @@ -6,6 +6,5 @@ /** * This package contains the implementation classes for ServiceBusManagementClient. - * Azure Service Bus client for managing Namespace, IPFilter Rules, VirtualNetworkRules and Zone Redundant. */ package com.microsoft.azure.management.servicebus.v2018_01_01_preview.implementation; diff --git a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/package-info.java b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/package-info.java index 2ac310a27068..4ca2ea764c1c 100644 --- a/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/package-info.java +++ b/sdk/servicebus/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/servicebus/v2018_01_01_preview/package-info.java @@ -6,6 +6,5 @@ /** * This package contains the classes for ServiceBusManagementClient. - * Azure Service Bus client for managing Namespace, IPFilter Rules, VirtualNetworkRules and Zone Redundant. */ package com.microsoft.azure.management.servicebus.v2018_01_01_preview;