diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index d2ece6aac488b..74b3a98be06df 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -318,6 +318,7 @@ com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-baremetalinfrastructure;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-quota;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-servicebus-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/CHANGELOG.md b/sdk/servicebus/azure-resourcemanager-servicebus-generated/CHANGELOG.md new file mode 100644 index 0000000000000..c46bfce0e94e9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-09-30) + +- Azure Resource Manager ServiceBus client library for Java. This package contains Microsoft Azure SDK for ServiceBus Management SDK. Azure Service Bus client for managing Namespace. Package tag package-2021-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/README.md b/sdk/servicebus/azure-resourcemanager-servicebus-generated/README.md new file mode 100644 index 0000000000000..66ff92379eb20 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager ServiceBus client library for Java + +Azure Resource Manager ServiceBus client library for Java. + +This package contains Microsoft Azure SDK for ServiceBus Management SDK. Azure Service Bus client for managing Namespace. Package tag package-2021-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-servicebus-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-servicebus-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ServiceBusManager manager = ServiceBusManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/pom.xml b/sdk/servicebus/azure-resourcemanager-servicebus-generated/pom.xml new file mode 100644 index 0000000000000..f687f8b3937a3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-servicebus-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ServiceBus Management + This package contains Microsoft Azure SDK for ServiceBus Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Service Bus client for managing Namespace. Package tag package-2021-06-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.20.0 + + + com.azure + azure-core-management + 1.4.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/ServiceBusManager.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/ServiceBusManager.java new file mode 100644 index 0000000000000..f59a72b5c9f03 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/ServiceBusManager.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.ServiceBusManagementClient; +import com.azure.resourcemanager.servicebus.generated.implementation.DisasterRecoveryConfigsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.MigrationConfigsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.NamespacesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.QueuesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.RulesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.ServiceBusManagementClientBuilder; +import com.azure.resourcemanager.servicebus.generated.implementation.SubscriptionsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.TopicsImpl; +import com.azure.resourcemanager.servicebus.generated.models.DisasterRecoveryConfigs; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigs; +import com.azure.resourcemanager.servicebus.generated.models.Namespaces; +import com.azure.resourcemanager.servicebus.generated.models.Operations; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.servicebus.generated.models.Queues; +import com.azure.resourcemanager.servicebus.generated.models.Rules; +import com.azure.resourcemanager.servicebus.generated.models.Subscriptions; +import com.azure.resourcemanager.servicebus.generated.models.Topics; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ServiceBusManager. Azure Service Bus client for managing Namespace. */ +public final class ServiceBusManager { + private Namespaces namespaces; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private Operations operations; + + private DisasterRecoveryConfigs disasterRecoveryConfigs; + + private MigrationConfigs migrationConfigs; + + private Queues queues; + + private Topics topics; + + private Rules rules; + + private Subscriptions subscriptions; + + private final ServiceBusManagementClient clientObject; + + private ServiceBusManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ServiceBusManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ServiceBus service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceBus service API instance. + */ + public static ServiceBusManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ServiceBusManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ServiceBusManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ServiceBus service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceBus service API instance. + */ + public ServiceBusManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.servicebus.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ServiceBusManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Namespaces. */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + } + return namespaces; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of DisasterRecoveryConfigs. */ + public DisasterRecoveryConfigs disasterRecoveryConfigs() { + if (this.disasterRecoveryConfigs == null) { + this.disasterRecoveryConfigs = + new DisasterRecoveryConfigsImpl(clientObject.getDisasterRecoveryConfigs(), this); + } + return disasterRecoveryConfigs; + } + + /** @return Resource collection API of MigrationConfigs. */ + public MigrationConfigs migrationConfigs() { + if (this.migrationConfigs == null) { + this.migrationConfigs = new MigrationConfigsImpl(clientObject.getMigrationConfigs(), this); + } + return migrationConfigs; + } + + /** @return Resource collection API of Queues. */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(clientObject.getQueues(), this); + } + return queues; + } + + /** @return Resource collection API of Topics. */ + public Topics topics() { + if (this.topics == null) { + this.topics = new TopicsImpl(clientObject.getTopics(), this); + } + return topics; + } + + /** @return Resource collection API of Rules. */ + public Rules rules() { + if (this.rules == null) { + this.rules = new RulesImpl(clientObject.getRules(), this); + } + return rules; + } + + /** @return Resource collection API of Subscriptions. */ + public Subscriptions subscriptions() { + if (this.subscriptions == null) { + this.subscriptions = new SubscriptionsImpl(clientObject.getSubscriptions(), this); + } + return subscriptions; + } + + /** + * @return Wrapped service client ServiceBusManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ServiceBusManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/DisasterRecoveryConfigsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/DisasterRecoveryConfigsClient.java new file mode 100644 index 0000000000000..c3a5dcb998dca --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/DisasterRecoveryConfigsClient.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; + +/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ +public interface DisasterRecoveryConfigsClient { + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters); + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmDisasterRecoveryInner createOrUpdate( + String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String alias, + ArmDisasterRecoveryInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String alias); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArmDisasterRecoveryInner get(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void breakPairing(String resourceGroupName, String namespaceName, String alias); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response breakPairingWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failOver(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. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String alias, 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 alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/MigrationConfigsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/MigrationConfigsClient.java new file mode 100644 index 0000000000000..4f5056da57036 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/MigrationConfigsClient.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** An instance of this class provides access to all the operations defined in MigrationConfigsClient. */ +public interface MigrationConfigsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, MigrationConfigPropertiesInner> beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters); + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, MigrationConfigPropertiesInner> beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context); + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters); + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationConfigPropertiesInner get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * 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 configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void completeMigration(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * 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 configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/NamespacesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/NamespacesClient.java new file mode 100644 index 0000000000000..edda8cd7e56c5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/NamespacesClient.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +public interface NamespacesClient { + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner update(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, Context context); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRuleSetInner createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName); + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets list of 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName); + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNetworkRuleSets( + String resourceGroupName, String namespaceName, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * 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 authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * 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 authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/OperationsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..c24b8142df79c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..c9db3ae4f4be7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateLinkResourcesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..c689182ca92a7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourcesListResultInner get(String resourceGroupName, String namespaceName); + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/QueuesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/QueuesClient.java new file mode 100644 index 0000000000000..28f7f44d87e84 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/QueuesClient.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** An instance of this class provides access to all the operations defined in QueuesClient. */ +public interface QueuesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBQueueInner createOrUpdate( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String queueName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBQueueInner get(String resourceGroupName, String namespaceName, String queueName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/RulesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/RulesClient.java new file mode 100644 index 0000000000000..512bdb27266ff --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/RulesClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; + +/** An instance of this class provides access to all the operations defined in RulesClient. */ +public interface RulesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/ServiceBusManagementClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/ServiceBusManagementClient.java new file mode 100644 index 0000000000000..13583bd732e51 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/ServiceBusManagementClient.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ServiceBusManagementClient class. */ +public interface ServiceBusManagementClient { + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + NamespacesClient getNamespaces(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the DisasterRecoveryConfigsClient object to access its operations. + * + * @return the DisasterRecoveryConfigsClient object. + */ + DisasterRecoveryConfigsClient getDisasterRecoveryConfigs(); + + /** + * Gets the MigrationConfigsClient object to access its operations. + * + * @return the MigrationConfigsClient object. + */ + MigrationConfigsClient getMigrationConfigs(); + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + QueuesClient getQueues(); + + /** + * Gets the TopicsClient object to access its operations. + * + * @return the TopicsClient object. + */ + TopicsClient getTopics(); + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + RulesClient getRules(); + + /** + * Gets the SubscriptionsClient object to access its operations. + * + * @return the SubscriptionsClient object. + */ + SubscriptionsClient getSubscriptions(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/SubscriptionsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/SubscriptionsClient.java new file mode 100644 index 0000000000000..248c79157348c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/SubscriptionsClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; + +/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ +public interface SubscriptionsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTopic(String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBSubscriptionInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBSubscriptionInner get(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/TopicsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/TopicsClient.java new file mode 100644 index 0000000000000..fdb4ea59e07c3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/TopicsClient.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** An instance of this class provides access to all the operations defined in TopicsClient. */ +public interface TopicsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBTopicInner createOrUpdate( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBTopicInner get(String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/AccessKeysInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/AccessKeysInner.java new file mode 100644 index 0000000000000..264a35a7cf378 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/AccessKeysInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Namespace/ServiceBus Connection String. */ +@Immutable +public final class AccessKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessKeysInner.class); + + /* + * 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 the primaryConnectionString property: Primary connection string of the created namespace authorization rule. + * + * @return the primaryConnectionString value. + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Get the secondaryConnectionString property: Secondary connection string of the created namespace authorization + * rule. + * + * @return the secondaryConnectionString value. + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Get the aliasPrimaryConnectionString property: Primary connection string of the alias if GEO DR is enabled. + * + * @return the aliasPrimaryConnectionString value. + */ + public String aliasPrimaryConnectionString() { + return this.aliasPrimaryConnectionString; + } + + /** + * Get the aliasSecondaryConnectionString property: Secondary connection string of the alias if GEO DR is enabled. + * + * @return the aliasSecondaryConnectionString value. + */ + public String aliasSecondaryConnectionString() { + return this.aliasSecondaryConnectionString; + } + + /** + * Get the primaryKey property: 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 the secondaryKey property: 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 the keyName property: A string that describes the authorization rule. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryInner.java new file mode 100644 index 0000000000000..00f03ba74e4ba --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.servicebus.generated.models.RoleDisasterRecovery; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single item in List or Get Alias(Disaster Recovery configuration) operation. */ +@JsonFlatten +@Fluent +public class ArmDisasterRecoveryInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Provisioning state of the Alias(Disaster Recovery configuration) - + * possible values 'Accepted' or 'Succeeded' or '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' + */ + @JsonProperty(value = "properties.role", access = JsonProperty.Access.WRITE_ONLY) + private RoleDisasterRecovery role; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the Alias(Disaster Recovery configuration) - possible + * values 'Accepted' or 'Succeeded' or 'Failed'. + * + * @return the provisioningState value. + */ + public ProvisioningStateDR provisioningState() { + return this.provisioningState; + } + + /** + * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Get the partnerNamespace property: 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 the partnerNamespace property: 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 the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set the alternateName property: 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 the role property: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or + * 'Secondary'. + * + * @return the role value. + */ + public RoleDisasterRecovery role() { + return this.role; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..cbe99d91b59d8 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.UnavailableReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a Check Name availability request properties. */ +@Fluent +public final class CheckNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); + + /* + * 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. + */ + @JsonProperty(value = "reason") + private UnavailableReason reason; + + /** + * Get the message property: The detailed info regarding the reason associated with the namespace. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the nameAvailable property: Value indicating namespace is availability, true if the namespace is available; + * otherwise, false. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: 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 property: The reason for unavailability of a namespace. + * + * @return the reason value. + */ + public UnavailableReason reason() { + return this.reason; + } + + /** + * Set the reason property: The reason for unavailability of a namespace. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withReason(UnavailableReason reason) { + this.reason = reason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesInner.java new file mode 100644 index 0000000000000..090f1a7d52b56 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single item in List or Get Migration Config operation. */ +@JsonFlatten +@Fluent +public class MigrationConfigPropertiesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationConfigPropertiesInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * 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") + private String targetNamespace; + + /* + * Name to access Standard Namespace after migration + */ + @JsonProperty(value = "properties.postMigrationName") + 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 the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of Migration Configuration. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Get the targetNamespace property: 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 the targetNamespace property: 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 the postMigrationName property: Name to access Standard Namespace after migration. + * + * @return the postMigrationName value. + */ + public String postMigrationName() { + return this.postMigrationName; + } + + /** + * Set the postMigrationName property: 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 the migrationState property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetInner.java new file mode 100644 index 0000000000000..791284cc4bcc4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccessFlag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of NetworkRuleSet resource. */ +@JsonFlatten +@Fluent +public class NetworkRuleSetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Value that indicates whether Trusted Service Access is Enabled or not. + */ + @JsonProperty(value = "properties.trustedServiceAccessEnabled") + private Boolean trustedServiceAccessEnabled; + + /* + * Default Action for Network Rule Set + */ + @JsonProperty(value = "properties.defaultAction") + private DefaultAction defaultAction; + + /* + * List VirtualNetwork Rules + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /* + * List of IpRules + */ + @JsonProperty(value = "properties.ipRules") + private List ipRules; + + /* + * This determines if traffic is allowed over public network. By default it + * is enabled. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccessFlag publicNetworkAccess; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + public Boolean trustedServiceAccessEnabled() { + return this.trustedServiceAccessEnabled; + } + + /** + * Set the trustedServiceAccessEnabled property: 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 the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default Action for Network Rule Set. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the virtualNetworkRules property: List VirtualNetwork Rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: List VirtualNetwork Rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: List of IpRules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessFlag publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withPublicNetworkAccess(PublicNetworkAccessFlag publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/OperationInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..ef8b15dee343d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/OperationInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A ServiceBus REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..dd2ce2ba0c92f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnection. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * 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. + */ + @JsonProperty(value = "properties.provisioningState") + private EndPointProvisioningState provisioningState; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: 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 the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: 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 the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + public EndPointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(EndPointProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourcesListResultInner.java new file mode 100644 index 0000000000000..fc95df1f5d8fb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourcesListResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List private link resources operation. */ +@Fluent +public final class PrivateLinkResourcesListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesListResultInner.class); + + /* + * 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 the value property: A collection of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: 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 the nextLink property: A link for the next page of private link resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/RuleInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/RuleInner.java new file mode 100644 index 0000000000000..77b821552882f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/RuleInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.Action; +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of Rule Resource. */ +@JsonFlatten +@Fluent +public class RuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * 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. + */ + @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 the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the action property: 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 the action property: 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 the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @return the filterType value. + */ + public FilterType filterType() { + return this.filterType; + } + + /** + * Set the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @param filterType the filterType value to set. + * @return the RuleInner object itself. + */ + public RuleInner withFilterType(FilterType filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get the sqlFilter property: Properties of sqlFilter. + * + * @return the sqlFilter value. + */ + public SqlFilter sqlFilter() { + return this.sqlFilter; + } + + /** + * Set the sqlFilter property: 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 the correlationFilter property: Properties of correlationFilter. + * + * @return the correlationFilter value. + */ + public CorrelationFilter correlationFilter() { + return this.correlationFilter; + } + + /** + * Set the correlationFilter property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() != null) { + action().validate(); + } + if (sqlFilter() != null) { + sqlFilter().validate(); + } + if (correlationFilter() != null) { + correlationFilter().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleInner.java new file mode 100644 index 0000000000000..f9d23b2ced20b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of a namespace authorization rule. */ +@JsonFlatten +@Fluent +public class SBAuthorizationRuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBAuthorizationRuleInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights") + private List rights; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the rights property: The rights associated with the rule. + * + * @return the rights value. + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceInner.java new file mode 100644 index 0000000000000..c6ae9a9816663 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceInner.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.Encryption; +import com.azure.resourcemanager.servicebus.generated.models.Identity; +import com.azure.resourcemanager.servicebus.generated.models.SBSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Description of a namespace resource. */ +@JsonFlatten +@Fluent +public class SBNamespaceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBNamespaceInner.class); + + /* + * Properties of SKU + */ + @JsonProperty(value = "sku") + private SBSku sku; + + /* + * Properties of BYOK Identity description + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Provisioning state of the namespace. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Status of the namespace. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The time the namespace was created + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Endpoint you can use to perform Service Bus operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceBusEndpoint; + + /* + * Identifier for Azure Insights metrics + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Enabling this property creates a Premium Service Bus Namespace in + * regions supported availability zones. + */ + @JsonProperty(value = "properties.zoneRedundant") + private Boolean zoneRedundant; + + /* + * Properties of BYOK Encryption description + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * List of private endpoint connections. + */ + @JsonProperty(value = "properties.privateEndpointConnections") + private List privateEndpointConnections; + + /* + * This property disables SAS authentication for the Service Bus namespace. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /** + * Get the sku property: Properties of SKU. + * + * @return the sku value. + */ + public SBSku sku() { + return this.sku; + } + + /** + * Set the sku property: Properties of SKU. + * + * @param sku the sku value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withSku(SBSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: 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 the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the namespace. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the namespace. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withZoneRedundant(Boolean zoneRedundant) { + this.zoneRedundant = zoneRedundant; + return this; + } + + /** + * Get the encryption property: Properties of BYOK Encryption description. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: 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; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueInner.java new file mode 100644 index 0000000000000..c2b9e7be22197 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueInner.java @@ -0,0 +1,599 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of queue Resource. */ +@JsonFlatten +@Fluent +public class SBQueueInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBQueueInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * 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 OffsetDateTime createdAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 OffsetDateTime 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 Duration 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; + + /* + * Maximum size (in KB) of the message payload that can be accepted by the + * queue. This property is only used in Premium today and default is 1024. + */ + @JsonProperty(value = "properties.maxMessageSizeInKilobytes") + private Long maxMessageSizeInKilobytes; + + /* + * 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 Duration 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 Duration 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. + */ + @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 Duration 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 the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the countDetails property: Message Count Details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the createdAt property: The exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the accessedAt property: Last time a message was sent, or the last time there was a receive request to this + * queue. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the sizeInBytes property: The size of the queue, in bytes. + * + * @return the sizeInBytes value. + */ + public Long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the messageCount property: The number of messages in the queue. + * + * @return the messageCount value. + */ + public Long messageCount() { + return this.messageCount; + } + + /** + * Get the lockDuration property: 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 Duration lockDuration() { + return this.lockDuration; + } + + /** + * Set the lockDuration property: 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(Duration lockDuration) { + this.lockDuration = lockDuration; + return this; + } + + /** + * Get the maxSizeInMegabytes property: 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 maxSizeInMegabytes property: 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 the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + public Long maxMessageSizeInKilobytes() { + return this.maxMessageSizeInKilobytes; + } + + /** + * Set the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @param maxMessageSizeInKilobytes the maxMessageSizeInKilobytes value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.maxMessageSizeInKilobytes = maxMessageSizeInKilobytes; + return this; + } + + /** + * Get the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + public Boolean requiresDuplicateDetection() { + return this.requiresDuplicateDetection; + } + + /** + * Set the requiresDuplicateDetection property: 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 the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @return the requiresSession value. + */ + public Boolean requiresSession() { + return this.requiresSession; + } + + /** + * Set the requiresSession property: 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 the defaultMessageTimeToLive property: 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 Duration defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set the defaultMessageTimeToLive property: 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(Duration defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get the deadLetteringOnMessageExpiration property: 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 the deadLetteringOnMessageExpiration property: 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 the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: 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(Duration duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the maxDeliveryCount property: 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 maxDeliveryCount property: 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 the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set the enableBatchedOperations property: 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 the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set the autoDeleteOnIdle property: 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(Duration autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get the enablePartitioning property: 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 the enablePartitioning property: 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 the enableExpress property: 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 the enableExpress property: 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 the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + public String forwardTo() { + return this.forwardTo; + } + + /** + * Set the forwardTo property: 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 the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + public String forwardDeadLetteredMessagesTo() { + return this.forwardDeadLetteredMessagesTo; + } + + /** + * Set the forwardDeadLetteredMessagesTo property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countDetails() != null) { + countDetails().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionInner.java new file mode 100644 index 0000000000000..186ec97a6f9e9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionInner.java @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBClientAffineProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of subscription resource. */ +@JsonFlatten +@Fluent +public class SBSubscriptionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBSubscriptionInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * 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 OffsetDateTime createdAt; + + /* + * Last time there was a receive request to this subscription. + */ + @JsonProperty(value = "properties.accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessedAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 Duration 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 Duration 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 Duration duplicateDetectionHistoryTimeWindow; + + /* + * Number of maximum deliveries. + */ + @JsonProperty(value = "properties.maxDeliveryCount") + private Integer maxDeliveryCount; + + /* + * Enumerates the possible values for the status of a messaging entity. + */ + @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 Duration 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; + + /* + * Value that indicates whether the subscription has an affinity to the + * client id. + */ + @JsonProperty(value = "properties.isClientAffine") + private Boolean isClientAffine; + + /* + * Properties specific to client affine subscriptions. + */ + @JsonProperty(value = "properties.clientAffineProperties") + private SBClientAffineProperties clientAffineProperties; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the messageCount property: Number of messages. + * + * @return the messageCount value. + */ + public Long messageCount() { + return this.messageCount; + } + + /** + * Get the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the accessedAt property: Last time there was a receive request to this subscription. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the countDetails property: Message count details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @return the lockDuration value. + */ + public Duration lockDuration() { + return this.lockDuration; + } + + /** + * Set the lockDuration property: 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(Duration lockDuration) { + this.lockDuration = lockDuration; + return this; + } + + /** + * Get the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @return the requiresSession value. + */ + public Boolean requiresSession() { + return this.requiresSession; + } + + /** + * Set the requiresSession property: 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 the defaultMessageTimeToLive property: 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 Duration defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set the defaultMessageTimeToLive property: 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(Duration defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get the deadLetteringOnFilterEvaluationExceptions property: 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 the deadLetteringOnFilterEvaluationExceptions property: 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 the deadLetteringOnMessageExpiration property: 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 the deadLetteringOnMessageExpiration property: 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 the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: 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(Duration duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the maxDeliveryCount property: Number of maximum deliveries. + * + * @return the maxDeliveryCount value. + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the maxDeliveryCount property: 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 the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set the enableBatchedOperations property: 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 the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set the autoDeleteOnIdle property: 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(Duration autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + public String forwardTo() { + return this.forwardTo; + } + + /** + * Set the forwardTo property: 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 the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + public String forwardDeadLetteredMessagesTo() { + return this.forwardDeadLetteredMessagesTo; + } + + /** + * Set the forwardDeadLetteredMessagesTo property: 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; + } + + /** + * Get the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @return the isClientAffine value. + */ + public Boolean isClientAffine() { + return this.isClientAffine; + } + + /** + * Set the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @param isClientAffine the isClientAffine value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withIsClientAffine(Boolean isClientAffine) { + this.isClientAffine = isClientAffine; + return this; + } + + /** + * Get the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @return the clientAffineProperties value. + */ + public SBClientAffineProperties clientAffineProperties() { + return this.clientAffineProperties; + } + + /** + * Set the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @param clientAffineProperties the clientAffineProperties value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withClientAffineProperties(SBClientAffineProperties clientAffineProperties) { + this.clientAffineProperties = clientAffineProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countDetails() != null) { + countDetails().validate(); + } + if (clientAffineProperties() != null) { + clientAffineProperties().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicInner.java new file mode 100644 index 0000000000000..38b85bd8c9323 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicInner.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of topic resource. */ +@JsonFlatten +@Fluent +public class SBTopicInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBTopicInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * 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 OffsetDateTime createdAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 OffsetDateTime 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 Duration 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; + + /* + * Maximum size (in KB) of the message payload that can be accepted by the + * topic. This property is only used in Premium today and default is 1024. + */ + @JsonProperty(value = "properties.maxMessageSizeInKilobytes") + private Long maxMessageSizeInKilobytes; + + /* + * 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 Duration 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. + */ + @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 Duration 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 the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the sizeInBytes property: Size of the topic, in bytes. + * + * @return the sizeInBytes value. + */ + public Long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the accessedAt property: Last time the message was sent, or a request was received, for this topic. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the subscriptionCount property: Number of subscriptions. + * + * @return the subscriptionCount value. + */ + public Integer subscriptionCount() { + return this.subscriptionCount; + } + + /** + * Get the countDetails property: Message count details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the defaultMessageTimeToLive property: 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 Duration defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set the defaultMessageTimeToLive property: 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(Duration defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get the maxSizeInMegabytes property: 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 the maxSizeInMegabytes property: 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 the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + public Long maxMessageSizeInKilobytes() { + return this.maxMessageSizeInKilobytes; + } + + /** + * Set the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @param maxMessageSizeInKilobytes the maxMessageSizeInKilobytes value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.maxMessageSizeInKilobytes = maxMessageSizeInKilobytes; + return this; + } + + /** + * Get the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + public Boolean requiresDuplicateDetection() { + return this.requiresDuplicateDetection; + } + + /** + * Set the requiresDuplicateDetection property: 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 the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: 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(Duration duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set the enableBatchedOperations property: 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 the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @return the supportOrdering value. + */ + public Boolean supportOrdering() { + return this.supportOrdering; + } + + /** + * Set the supportOrdering property: 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 the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set the autoDeleteOnIdle property: 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(Duration autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get the enablePartitioning property: 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 the enablePartitioning property: 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 the enableExpress property: 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 the enableExpress property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countDetails() != null) { + countDetails().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..aebc6cdfc4a01 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for ServiceBusManagementClient. Azure Service Bus client for managing + * Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.fluent.models; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/package-info.java new file mode 100644 index 0000000000000..8904d3e4bed67 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for ServiceBusManagementClient. Azure Service Bus client for managing + * Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.fluent; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/AccessKeysImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/AccessKeysImpl.java new file mode 100644 index 0000000000000..160cd328ea14c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/AccessKeysImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; + +public final class AccessKeysImpl implements AccessKeys { + private AccessKeysInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + AccessKeysImpl( + AccessKeysInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primaryConnectionString() { + return this.innerModel().primaryConnectionString(); + } + + public String secondaryConnectionString() { + return this.innerModel().secondaryConnectionString(); + } + + public String aliasPrimaryConnectionString() { + return this.innerModel().aliasPrimaryConnectionString(); + } + + public String aliasSecondaryConnectionString() { + return this.innerModel().aliasSecondaryConnectionString(); + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public String keyName() { + return this.innerModel().keyName(); + } + + public AccessKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ArmDisasterRecoveryImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ArmDisasterRecoveryImpl.java new file mode 100644 index 0000000000000..0a0e0cf543dc4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ArmDisasterRecoveryImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.models.ArmDisasterRecovery; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; +import com.azure.resourcemanager.servicebus.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.servicebus.generated.models.RoleDisasterRecovery; + +public final class ArmDisasterRecoveryImpl + implements ArmDisasterRecovery, ArmDisasterRecovery.Definition, ArmDisasterRecovery.Update { + private ArmDisasterRecoveryInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningStateDR provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long pendingReplicationOperationsCount() { + return this.innerModel().pendingReplicationOperationsCount(); + } + + public String partnerNamespace() { + return this.innerModel().partnerNamespace(); + } + + public String alternateName() { + return this.innerModel().alternateName(); + } + + public RoleDisasterRecovery role() { + return this.innerModel().role(); + } + + public ArmDisasterRecoveryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String alias; + + public ArmDisasterRecoveryImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public ArmDisasterRecovery create() { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ArmDisasterRecovery create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), context) + .getValue(); + return this; + } + + ArmDisasterRecoveryImpl( + String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new ArmDisasterRecoveryInner(); + this.serviceManager = serviceManager; + this.alias = name; + } + + public ArmDisasterRecoveryImpl update() { + return this; + } + + public ArmDisasterRecovery apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ArmDisasterRecovery apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), context) + .getValue(); + return this; + } + + ArmDisasterRecoveryImpl( + ArmDisasterRecoveryInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.alias = Utils.getValueFromIdByName(innerObject.id(), "disasterRecoveryConfigs"); + } + + public ArmDisasterRecovery refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .getWithResponse(resourceGroupName, namespaceName, alias, Context.NONE) + .getValue(); + return this; + } + + public ArmDisasterRecovery refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .getWithResponse(resourceGroupName, namespaceName, alias, context) + .getValue(); + return this; + } + + public void breakPairing() { + serviceManager.disasterRecoveryConfigs().breakPairing(resourceGroupName, namespaceName, alias); + } + + public Response breakPairingWithResponse(Context context) { + return serviceManager + .disasterRecoveryConfigs() + .breakPairingWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public void failOver() { + serviceManager.disasterRecoveryConfigs().failOver(resourceGroupName, namespaceName, alias); + } + + public Response failOverWithResponse(FailoverProperties parameters, Context context) { + return serviceManager + .disasterRecoveryConfigs() + .failOverWithResponse(resourceGroupName, namespaceName, alias, parameters, context); + } + + public ArmDisasterRecoveryImpl withPartnerNamespace(String partnerNamespace) { + this.innerModel().withPartnerNamespace(partnerNamespace); + return this; + } + + public ArmDisasterRecoveryImpl withAlternateName(String alternateName) { + this.innerModel().withAlternateName(alternateName); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/CheckNameAvailabilityResultImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..bcb2fad2862bb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.servicebus.generated.models.UnavailableReason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public UnavailableReason reason() { + return this.innerModel().reason(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsClientImpl.java new file mode 100644 index 0000000000000..4eba6b1710c34 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsClientImpl.java @@ -0,0 +1,2150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.ArmDisasterRecoveryListResult; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ +public final class DisasterRecoveryConfigsClientImpl implements DisasterRecoveryConfigsClient { + private final ClientLogger logger = new ClientLogger(DisasterRecoveryConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DisasterRecoveryConfigsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of DisasterRecoveryConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DisasterRecoveryConfigsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy + .create(DisasterRecoveryConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientDisasterRecoveryConfigs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface DisasterRecoveryConfigsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailability parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ArmDisasterRecoveryInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> breakPairing( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> failOver( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FailoverProperties parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules" + + "/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules" + + "/{authorizationRuleName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + return checkNameAvailabilityAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String alias, + ArmDisasterRecoveryInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, alias, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmDisasterRecoveryInner createOrUpdate( + String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, alias, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String alias, + ArmDisasterRecoveryInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, alias, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, String alias) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, alias) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String alias) { + deleteAsync(resourceGroupName, namespaceName, alias).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String alias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String alias) { + return getWithResponseAsync(resourceGroupName, namespaceName, alias) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) { + return getAsync(resourceGroupName, namespaceName, alias).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> breakPairingWithResponseAsync( + String resourceGroupName, String namespaceName, String alias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .breakPairing( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> breakPairingWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .breakPairing( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { + return breakPairingWithResponseAsync(resourceGroupName, namespaceName, alias) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void breakPairing(String resourceGroupName, String namespaceName, String alias) { + breakPairingAsync(resourceGroupName, namespaceName, alias).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response breakPairingWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return breakPairingWithResponseAsync(resourceGroupName, namespaceName, alias, context).block(); + } + + /** + * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> failOverWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .failOver( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> failOverWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .failOver( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failOverAsync( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters) { + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failOverAsync(String resourceGroupName, String namespaceName, String alias) { + final FailoverProperties parameters = null; + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failOver(String resourceGroupName, String namespaceName, String alias) { + final FailoverProperties parameters = null; + failOverAsync(resourceGroupName, namespaceName, alias, parameters).block(); + } + + /** + * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context) { + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String alias) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String alias, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String alias) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String alias, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, alias, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return listKeysAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List Alias(Disaster Recovery configuration) operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsImpl.java new file mode 100644 index 0000000000000..5c4af1b922d84 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsImpl.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.ArmDisasterRecovery; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.servicebus.generated.models.DisasterRecoveryConfigs; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DisasterRecoveryConfigsImpl.class); + + private final DisasterRecoveryConfigsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public DisasterRecoveryConfigsImpl( + DisasterRecoveryConfigsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + CheckNameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, namespaceName, parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new ArmDisasterRecoveryImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new ArmDisasterRecoveryImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String alias) { + this.serviceClient().delete(resourceGroupName, namespaceName, alias); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public ArmDisasterRecovery get(String resourceGroupName, String namespaceName, String alias) { + ArmDisasterRecoveryInner inner = this.serviceClient().get(resourceGroupName, namespaceName, alias); + if (inner != null) { + return new ArmDisasterRecoveryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, alias, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArmDisasterRecoveryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void breakPairing(String resourceGroupName, String namespaceName, String alias) { + this.serviceClient().breakPairing(resourceGroupName, namespaceName, alias); + } + + public Response breakPairingWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return this.serviceClient().breakPairingWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public void failOver(String resourceGroupName, String namespaceName, String alias) { + this.serviceClient().failOver(resourceGroupName, namespaceName, alias); + } + + public Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context) { + return this.serviceClient().failOverWithResponse(resourceGroupName, namespaceName, alias, parameters, context); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, alias); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, alias, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, alias, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys listKeys( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + AccessKeysInner inner = + this.serviceClient().listKeys(resourceGroupName, namespaceName, alias, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + Response inner = + this + .serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, alias, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArmDisasterRecovery getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String alias = Utils.getValueFromIdByName(id, "disasterRecoveryConfigs"); + if (alias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'disasterRecoveryConfigs'.", + id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, alias, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String alias = Utils.getValueFromIdByName(id, "disasterRecoveryConfigs"); + if (alias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'disasterRecoveryConfigs'.", + id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String alias = Utils.getValueFromIdByName(id, "disasterRecoveryConfigs"); + if (alias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'disasterRecoveryConfigs'.", + id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, alias, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String alias = Utils.getValueFromIdByName(id, "disasterRecoveryConfigs"); + if (alias == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'disasterRecoveryConfigs'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, alias, context); + } + + private DisasterRecoveryConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public ArmDisasterRecoveryImpl define(String name) { + return new ArmDisasterRecoveryImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigPropertiesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigPropertiesImpl.java new file mode 100644 index 0000000000000..866b668071231 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigPropertiesImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigProperties; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +public final class MigrationConfigPropertiesImpl + implements MigrationConfigProperties, MigrationConfigProperties.Definition { + private MigrationConfigPropertiesInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + MigrationConfigPropertiesImpl( + MigrationConfigPropertiesInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long pendingReplicationOperationsCount() { + return this.innerModel().pendingReplicationOperationsCount(); + } + + public String targetNamespace() { + return this.innerModel().targetNamespace(); + } + + public String postMigrationName() { + return this.innerModel().postMigrationName(); + } + + public String migrationState() { + return this.innerModel().migrationState(); + } + + public MigrationConfigPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private MigrationConfigurationName configName; + + public MigrationConfigPropertiesImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public MigrationConfigProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .createAndStartMigration(resourceGroupName, namespaceName, configName, this.innerModel(), Context.NONE); + return this; + } + + public MigrationConfigProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .createAndStartMigration(resourceGroupName, namespaceName, configName, this.innerModel(), context); + return this; + } + + MigrationConfigPropertiesImpl( + MigrationConfigurationName name, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new MigrationConfigPropertiesInner(); + this.serviceManager = serviceManager; + this.configName = name; + } + + public MigrationConfigProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .getWithResponse(resourceGroupName, namespaceName, configName, Context.NONE) + .getValue(); + return this; + } + + public MigrationConfigProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .getWithResponse(resourceGroupName, namespaceName, configName, context) + .getValue(); + return this; + } + + public void completeMigration() { + serviceManager.migrationConfigs().completeMigration(resourceGroupName, namespaceName, configName); + } + + public Response completeMigrationWithResponse(Context context) { + return serviceManager + .migrationConfigs() + .completeMigrationWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void revert() { + serviceManager.migrationConfigs().revert(resourceGroupName, namespaceName, configName); + } + + public Response revertWithResponse(Context context) { + return serviceManager + .migrationConfigs() + .revertWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public MigrationConfigPropertiesImpl withTargetNamespace(String targetNamespace) { + this.innerModel().withTargetNamespace(targetNamespace); + return this; + } + + public MigrationConfigPropertiesImpl withPostMigrationName(String postMigrationName) { + this.innerModel().withPostMigrationName(postMigrationName); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsClientImpl.java new file mode 100644 index 0000000000000..47b4327edcff6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsClientImpl.java @@ -0,0 +1,1399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.MigrationConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigListResult; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MigrationConfigsClient. */ +public final class MigrationConfigsClientImpl implements MigrationConfigsClient { + private final ClientLogger logger = new ClientLogger(MigrationConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MigrationConfigsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of MigrationConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationConfigsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(MigrationConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientMigrationConfigs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface MigrationConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createAndStartMigration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") MigrationConfigPropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> completeMigration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> revert( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createAndStartMigrationWithResponseAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createAndStartMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createAndStartMigrationWithResponseAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createAndStartMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, MigrationConfigPropertiesInner> + beginCreateAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + Mono>> mono = + createAndStartMigrationWithResponseAsync(resourceGroupName, namespaceName, configName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationConfigPropertiesInner.class, + MigrationConfigPropertiesInner.class, + Context.NONE); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, MigrationConfigPropertiesInner> + beginCreateAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createAndStartMigrationWithResponseAsync(resourceGroupName, namespaceName, configName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationConfigPropertiesInner.class, + MigrationConfigPropertiesInner.class, + context); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MigrationConfigPropertiesInner> + beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters) + .getSyncPoller(); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MigrationConfigPropertiesInner> + beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters, context) + .getSyncPoller(); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + return createAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters).block(); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + return createAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters, context).block(); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, configName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + deleteAsync(resourceGroupName, namespaceName, configName).block(); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return getWithResponseAsync(resourceGroupName, namespaceName, configName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationConfigPropertiesInner get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return getAsync(resourceGroupName, namespaceName, configName).block(); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeMigrationWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .completeMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeMigrationWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .completeMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono completeMigrationAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return completeMigrationWithResponseAsync(resourceGroupName, namespaceName, configName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void completeMigration( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + completeMigrationAsync(resourceGroupName, namespaceName, configName).block(); + } + + /** + * 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 configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return completeMigrationWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revertWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revert( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revertWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revert( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revertAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return revertWithResponseAsync(resourceGroupName, namespaceName, configName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + revertAsync(resourceGroupName, namespaceName, configName).block(); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return revertWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List migrationConfigurations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List migrationConfigurations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsImpl.java new file mode 100644 index 0000000000000..445e97d730bd3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.MigrationConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigProperties; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigs; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MigrationConfigsImpl implements MigrationConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationConfigsImpl.class); + + private final MigrationConfigsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public MigrationConfigsImpl( + MigrationConfigsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new MigrationConfigPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new MigrationConfigPropertiesImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + this.serviceClient().delete(resourceGroupName, namespaceName, configName); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public MigrationConfigProperties get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + MigrationConfigPropertiesInner inner = this.serviceClient().get(resourceGroupName, namespaceName, configName); + if (inner != null) { + return new MigrationConfigPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, configName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MigrationConfigPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void completeMigration( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + this.serviceClient().completeMigration(resourceGroupName, namespaceName, configName); + } + + public Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return this + .serviceClient() + .completeMigrationWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + this.serviceClient().revert(resourceGroupName, namespaceName, configName); + } + + public Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return this.serviceClient().revertWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public MigrationConfigProperties getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + MigrationConfigurationName configName = + MigrationConfigurationName.fromString(Utils.getValueFromIdByName(id, "migrationConfigurations")); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, configName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + MigrationConfigurationName configName = + MigrationConfigurationName.fromString(Utils.getValueFromIdByName(id, "migrationConfigurations")); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + MigrationConfigurationName configName = + MigrationConfigurationName.fromString(Utils.getValueFromIdByName(id, "migrationConfigurations")); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, configName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + MigrationConfigurationName configName = + MigrationConfigurationName.fromString(Utils.getValueFromIdByName(id, "migrationConfigurations")); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, configName, context); + } + + private MigrationConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public MigrationConfigPropertiesImpl define(MigrationConfigurationName name) { + return new MigrationConfigPropertiesImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesClientImpl.java new file mode 100644 index 0000000000000..c1d461a76ba09 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesClientImpl.java @@ -0,0 +1,3492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleSetListResult; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +public final class NamespacesClientImpl implements NamespacesClient { + private final ClientLogger logger = new ClientLogger(NamespacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NamespacesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of NamespacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NamespacesClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientNamespaces to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface NamespacesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBNamespaceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBNamespaceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/networkRuleSets/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateNetworkRuleSet( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkRuleSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/networkRuleSets/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNetworkRuleSet( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/networkRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNetworkRuleSets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBAuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailability parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNetworkRuleSetsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SBNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SBNamespaceInner.class, SBNamespaceInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SBNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SBNamespaceInner.class, SBNamespaceInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String namespaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { + return beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName) { + deleteAsync(resourceGroupName, namespaceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, Context context) { + deleteAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupAsync(resourceGroupName, namespaceName).block(); + } + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner update( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateNetworkRuleSet( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateNetworkRuleSet( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateNetworkRuleSetAsync( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRuleSetInner createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { + return createOrUpdateNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getNetworkRuleSet( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNetworkRuleSet( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetAsync(resourceGroupName, namespaceName).block(); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * Gets list of 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsSinglePageAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listNetworkRuleSets( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNetworkRuleSets( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets list of 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listNetworkRuleSetsAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listNetworkRuleSetsNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listNetworkRuleSetsAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNetworkRuleSetsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets list of 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listNetworkRuleSetsAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNetworkRuleSets( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listNetworkRuleSetsAsync(resourceGroupName, namespaceName, context)); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .block(); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, context) + .block(); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + } + + /** + * 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 authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) + .block(); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailability parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailability parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponseAsync(parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters) { + return checkNameAvailabilityAsync(parameters).block(); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List NetworkRuleSet operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listNetworkRuleSetsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List NetworkRuleSet operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNetworkRuleSetsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesImpl.java new file mode 100644 index 0000000000000..11e1e990f3c87 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesImpl.java @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.servicebus.generated.models.Namespaces; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespace; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NamespacesImpl implements Namespaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespacesImpl.class); + + private final NamespacesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public NamespacesImpl( + NamespacesClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String namespaceName) { + this.serviceClient().delete(resourceGroupName, namespaceName); + } + + public void delete(String resourceGroupName, String namespaceName, Context context) { + this.serviceClient().delete(resourceGroupName, namespaceName, context); + } + + public SBNamespace getByResourceGroup(String resourceGroupName, String namespaceName) { + SBNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); + if (inner != null) { + return new SBNamespaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBNamespaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkRuleSet createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + NetworkRuleSetInner inner = + this.serviceClient().createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, parameters); + if (inner != null) { + return new NetworkRuleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateNetworkRuleSetWithResponse(resourceGroupName, namespaceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkRuleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName) { + NetworkRuleSetInner inner = this.serviceClient().getNetworkRuleSet(resourceGroupName, namespaceName); + if (inner != null) { + return new NetworkRuleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + Response inner = + this.serviceClient().getNetworkRuleSetWithResponse(resourceGroupName, namespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkRuleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listNetworkRuleSets(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new NetworkRuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listNetworkRuleSets( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listNetworkRuleSets(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkRuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + AccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBNamespace getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + } + + public SBAuthorizationRule getAuthorizationRuleById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + return this + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + } + + public Response getAuthorizationRuleByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + return this.getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + this.delete(resourceGroupName, namespaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + this.delete(resourceGroupName, namespaceName, context); + } + + public void deleteAuthorizationRuleById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + this + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + } + + public Response deleteAuthorizationRuleByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + return this + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + private NamespacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public SBNamespaceImpl define(String name) { + return new SBNamespaceImpl(name, this.manager()); + } + + public SBAuthorizationRuleImpl defineAuthorizationRule(String name) { + return new SBAuthorizationRuleImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NetworkRuleSetImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NetworkRuleSetImpl.java new file mode 100644 index 0000000000000..89f3c5fb57efe --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NetworkRuleSetImpl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccessFlag; +import java.util.Collections; +import java.util.List; + +public final class NetworkRuleSetImpl implements NetworkRuleSet { + private NetworkRuleSetInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + NetworkRuleSetImpl( + NetworkRuleSetInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Boolean trustedServiceAccessEnabled() { + return this.innerModel().trustedServiceAccessEnabled(); + } + + public DefaultAction defaultAction() { + return this.innerModel().defaultAction(); + } + + public List virtualNetworkRules() { + List inner = this.innerModel().virtualNetworkRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ipRules() { + List inner = this.innerModel().ipRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccessFlag publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public NetworkRuleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..35ce8eb213cfa --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.servicebus.generated.models.Operation; +import com.azure.resourcemanager.servicebus.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..11a7142f1aad5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.OperationsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.servicebus.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceBus/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..7402c8c200048 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.OperationsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.servicebus.generated.models.Operation; +import com.azure.resourcemanager.servicebus.generated.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..86061d48d4fe3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnection; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public ConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public EndPointProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + ConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public PrivateEndpointConnectionImpl withProvisioningState(EndPointProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..3c2b38f2ea814 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1035 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, privateEndpointConnectionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list of all private endpoint connections operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list of all private endpoint connections operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..f8970a2caaa85 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, namespaceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, namespaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..050f4a232c6fb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientPrivateLinkResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName) { + return getWithResponseAsync(resourceGroupName, namespaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourcesListResultInner get(String resourceGroupName, String namespaceName) { + return getAsync(resourceGroupName, namespaceName).block(); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..fa49f970aa88b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResourcesListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResourcesListResult get(String resourceGroupName, String namespaceName) { + PrivateLinkResourcesListResultInner inner = this.serviceClient().get(resourceGroupName, namespaceName); + if (inner != null) { + return new PrivateLinkResourcesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourcesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 0000000000000..c3fc519eef028 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResourcesListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourcesListResultImpl implements PrivateLinkResourcesListResult { + private PrivateLinkResourcesListResultInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + PrivateLinkResourcesListResultImpl( + PrivateLinkResourcesListResultInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public PrivateLinkResourcesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesClientImpl.java new file mode 100644 index 0000000000000..9f20dda1a3003 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesClientImpl.java @@ -0,0 +1,2327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.QueuesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBQueueListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QueuesClient. */ +public final class QueuesClientImpl implements QueuesClient { + private final ClientLogger logger = new ClientLogger(QueuesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final QueuesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of QueuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueuesClientImpl(ServiceBusManagementClientImpl client) { + this.service = RestProxy.create(QueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientQueues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface QueuesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBAuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}" + + "/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBQueueInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String queueName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName, context)); + } + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .block(); + } + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByNamespace( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNamespace( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top, context), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, queueName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBQueueInner createOrUpdate( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, queueName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, queueName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, String queueName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, queueName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String queueName) { + deleteAsync(resourceGroupName, namespaceName, queueName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, queueName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String queueName) { + return getWithResponseAsync(resourceGroupName, namespaceName, queueName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBQueueInner get(String resourceGroupName, String namespaceName, String queueName) { + return getAsync(resourceGroupName, namespaceName, queueName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, queueName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Queues operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Queues operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesImpl.java new file mode 100644 index 0000000000000..181d9ef6c1d7d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesImpl.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.QueuesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.Queues; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.azure.resourcemanager.servicebus.generated.models.SBQueue; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class QueuesImpl implements Queues { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueuesImpl.class); + + private final QueuesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public QueuesImpl( + QueuesClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, queueName); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, queueName, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .createOrUpdateAuthorizationRule( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + this + .serviceClient() + .deleteAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName); + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context); + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys listKeys( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + AccessKeysInner inner = + this.serviceClient().listKeys(resourceGroupName, namespaceName, queueName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, queueName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this + .serviceClient() + .regenerateKeys(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SBQueueImpl(inner1, this.manager())); + } + + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByNamespace(resourceGroupName, namespaceName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new SBQueueImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String queueName) { + this.serviceClient().delete(resourceGroupName, namespaceName, queueName); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, queueName, context); + } + + public SBQueue get(String resourceGroupName, String namespaceName, String queueName) { + SBQueueInner inner = this.serviceClient().get(resourceGroupName, namespaceName, queueName); + if (inner != null) { + return new SBQueueImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, queueName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBQueueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBQueue getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, queueName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, queueName, context); + } + + private QueuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public SBQueueImpl define(String name) { + return new SBQueueImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RuleImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RuleImpl.java new file mode 100644 index 0000000000000..07f33ae5a1114 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RuleImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.servicebus.generated.models.Action; +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.Rule; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; + +public final class RuleImpl implements Rule, Rule.Definition, Rule.Update { + private RuleInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Action action() { + return this.innerModel().action(); + } + + public FilterType filterType() { + return this.innerModel().filterType(); + } + + public SqlFilter sqlFilter() { + return this.innerModel().sqlFilter(); + } + + public CorrelationFilter correlationFilter() { + return this.innerModel().correlationFilter(); + } + + public RuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String topicName; + + private String subscriptionName; + + private String ruleName; + + public RuleImpl withExistingResourceGroup( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.topicName = topicName; + this.subscriptionName = subscriptionName; + return this; + } + + public Rule create() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public Rule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + RuleImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new RuleInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public RuleImpl update() { + return this; + } + + public Rule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public Rule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + RuleImpl(RuleInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.topicName = Utils.getValueFromIdByName(innerObject.id(), "topics"); + this.subscriptionName = Utils.getValueFromIdByName(innerObject.id(), "subscriptions"); + this.ruleName = Utils.getValueFromIdByName(innerObject.id(), "rules"); + } + + public Rule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public Rule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context) + .getValue(); + return this; + } + + public RuleImpl withAction(Action action) { + this.innerModel().withAction(action); + return this; + } + + public RuleImpl withFilterType(FilterType filterType) { + this.innerModel().withFilterType(filterType); + return this; + } + + public RuleImpl withSqlFilter(SqlFilter sqlFilter) { + this.innerModel().withSqlFilter(sqlFilter); + return this; + } + + public RuleImpl withCorrelationFilter(CorrelationFilter correlationFilter) { + this.innerModel().withCorrelationFilter(correlationFilter); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesClientImpl.java new file mode 100644 index 0000000000000..1524a4be51ad7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesClientImpl.java @@ -0,0 +1,1155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.RulesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.servicebus.generated.models.RuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RulesClient. */ +public final class RulesClientImpl implements RulesClient { + private final ClientLogger logger = new ClientLogger(RulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RulesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of RulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RulesClientImpl(ServiceBusManagementClientImpl client) { + this.service = RestProxy.create(RulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface RulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptions( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsSinglePageAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySubscriptions( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsSinglePageAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptions( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionsAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top) { + return new PagedFlux<>( + () -> + listBySubscriptionsSinglePageAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top), + nextLink -> listBySubscriptionsNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionsAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> + listBySubscriptionsSinglePageAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top), + nextLink -> listBySubscriptionsNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionsAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + return new PagedFlux<>( + () -> + listBySubscriptionsSinglePageAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top, context), + nextLink -> listBySubscriptionsNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>( + listBySubscriptionsAsync(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + return new PagedIterable<>( + listBySubscriptionsAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters) + .block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + deleteAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return getAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesImpl.java new file mode 100644 index 0000000000000..ab0c25126fa8b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesImpl.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.RulesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.servicebus.generated.models.Rule; +import com.azure.resourcemanager.servicebus.generated.models.Rules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RulesImpl implements Rules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesImpl.class); + + private final RulesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public RulesImpl( + RulesClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + PagedIterable inner = + this.serviceClient().listBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName); + return Utils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + this.serviceClient().delete(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + } + + public Rule get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + RuleInner inner = + this.serviceClient().get(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName); + if (inner != null) { + return new RuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Rule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + } + + private RulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public RuleImpl define(String name) { + return new RuleImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBAuthorizationRuleImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBAuthorizationRuleImpl.java new file mode 100644 index 0000000000000..a87484b469487 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBAuthorizationRuleImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import java.util.Collections; +import java.util.List; + +public final class SBAuthorizationRuleImpl + implements SBAuthorizationRule, SBAuthorizationRule.Definition, SBAuthorizationRule.Update { + private SBAuthorizationRuleInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List rights() { + List inner = this.innerModel().rights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SBAuthorizationRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String authorizationRuleName; + + public SBAuthorizationRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SBAuthorizationRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBAuthorizationRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + SBAuthorizationRuleImpl( + String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBAuthorizationRuleInner(); + this.serviceManager = serviceManager; + this.authorizationRuleName = name; + } + + public SBAuthorizationRuleImpl update() { + return this; + } + + public SBAuthorizationRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBAuthorizationRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + SBAuthorizationRuleImpl( + SBAuthorizationRuleInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.authorizationRuleName = Utils.getValueFromIdByName(innerObject.id(), "AuthorizationRules"); + } + + public SBAuthorizationRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + return this; + } + + public SBAuthorizationRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context) + .getValue(); + return this; + } + + public AccessKeys listKeys() { + return serviceManager.namespaces().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + } + + public Response listKeysWithResponse(Context context) { + return serviceManager + .namespaces() + .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters) { + return serviceManager + .namespaces() + .regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + } + + public Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context) { + return serviceManager + .namespaces() + .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + } + + public SBAuthorizationRuleImpl withRights(List rights) { + this.innerModel().withRights(rights); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBNamespaceImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBNamespaceImpl.java new file mode 100644 index 0000000000000..f5f017fe203e3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBNamespaceImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.Encryption; +import com.azure.resourcemanager.servicebus.generated.models.Identity; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespace; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceUpdateParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBSku; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class SBNamespaceImpl implements SBNamespace, SBNamespace.Definition, SBNamespace.Update { + private SBNamespaceInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SBSku sku() { + return this.innerModel().sku(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public String serviceBusEndpoint() { + return this.innerModel().serviceBusEndpoint(); + } + + public String metricId() { + return this.innerModel().metricId(); + } + + public Boolean zoneRedundant() { + return this.innerModel().zoneRedundant(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableLocalAuth() { + return this.innerModel().disableLocalAuth(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SBNamespaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private SBNamespaceUpdateParameters updateParameters; + + public SBNamespaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SBNamespace create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), Context.NONE); + return this; + } + + public SBNamespace create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), context); + return this; + } + + SBNamespaceImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBNamespaceInner(); + this.serviceManager = serviceManager; + this.namespaceName = name; + } + + public SBNamespaceImpl update() { + this.updateParameters = new SBNamespaceUpdateParameters(); + return this; + } + + public SBNamespace apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SBNamespace apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, context) + .getValue(); + return this; + } + + SBNamespaceImpl( + SBNamespaceInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + } + + public SBNamespace refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE) + .getValue(); + return this; + } + + public SBNamespace refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, context) + .getValue(); + return this; + } + + public SBNamespaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SBNamespaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SBNamespaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SBNamespaceImpl withSku(SBSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public SBNamespaceImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public SBNamespaceImpl withZoneRedundant(Boolean zoneRedundant) { + if (isInCreateMode()) { + this.innerModel().withZoneRedundant(zoneRedundant); + return this; + } else { + this.updateParameters.withZoneRedundant(zoneRedundant); + return this; + } + } + + public SBNamespaceImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public SBNamespaceImpl withPrivateEndpointConnections( + List privateEndpointConnections) { + if (isInCreateMode()) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } else { + this.updateParameters.withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + } + + public SBNamespaceImpl withDisableLocalAuth(Boolean disableLocalAuth) { + if (isInCreateMode()) { + this.innerModel().withDisableLocalAuth(disableLocalAuth); + return this; + } else { + this.updateParameters.withDisableLocalAuth(disableLocalAuth); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBQueueImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBQueueImpl.java new file mode 100644 index 0000000000000..ea7d2920b3a82 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBQueueImpl.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBQueue; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class SBQueueImpl implements SBQueue, SBQueue.Definition, SBQueue.Update { + private SBQueueInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MessageCountDetails countDetails() { + return this.innerModel().countDetails(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public OffsetDateTime accessedAt() { + return this.innerModel().accessedAt(); + } + + public Long sizeInBytes() { + return this.innerModel().sizeInBytes(); + } + + public Long messageCount() { + return this.innerModel().messageCount(); + } + + public Duration lockDuration() { + return this.innerModel().lockDuration(); + } + + public Integer maxSizeInMegabytes() { + return this.innerModel().maxSizeInMegabytes(); + } + + public Long maxMessageSizeInKilobytes() { + return this.innerModel().maxMessageSizeInKilobytes(); + } + + public Boolean requiresDuplicateDetection() { + return this.innerModel().requiresDuplicateDetection(); + } + + public Boolean requiresSession() { + return this.innerModel().requiresSession(); + } + + public Duration defaultMessageTimeToLive() { + return this.innerModel().defaultMessageTimeToLive(); + } + + public Boolean deadLetteringOnMessageExpiration() { + return this.innerModel().deadLetteringOnMessageExpiration(); + } + + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerModel().duplicateDetectionHistoryTimeWindow(); + } + + public Integer maxDeliveryCount() { + return this.innerModel().maxDeliveryCount(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public Boolean enableBatchedOperations() { + return this.innerModel().enableBatchedOperations(); + } + + public Duration autoDeleteOnIdle() { + return this.innerModel().autoDeleteOnIdle(); + } + + public Boolean enablePartitioning() { + return this.innerModel().enablePartitioning(); + } + + public Boolean enableExpress() { + return this.innerModel().enableExpress(); + } + + public String forwardTo() { + return this.innerModel().forwardTo(); + } + + public String forwardDeadLetteredMessagesTo() { + return this.innerModel().forwardDeadLetteredMessagesTo(); + } + + public SBQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String queueName; + + public SBQueueImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SBQueue create() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBQueue create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + SBQueueImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBQueueInner(); + this.serviceManager = serviceManager; + this.queueName = name; + } + + public SBQueueImpl update() { + return this; + } + + public SBQueue apply() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBQueue apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + SBQueueImpl( + SBQueueInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.queueName = Utils.getValueFromIdByName(innerObject.id(), "queues"); + } + + public SBQueue refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE) + .getValue(); + return this; + } + + public SBQueue refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, namespaceName, queueName, context) + .getValue(); + return this; + } + + public SBQueueImpl withLockDuration(Duration lockDuration) { + this.innerModel().withLockDuration(lockDuration); + return this; + } + + public SBQueueImpl withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.innerModel().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + public SBQueueImpl withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.innerModel().withMaxMessageSizeInKilobytes(maxMessageSizeInKilobytes); + return this; + } + + public SBQueueImpl withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.innerModel().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + public SBQueueImpl withRequiresSession(Boolean requiresSession) { + this.innerModel().withRequiresSession(requiresSession); + return this; + } + + public SBQueueImpl withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.innerModel().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + public SBQueueImpl withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.innerModel().withDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpiration); + return this; + } + + public SBQueueImpl withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + this.innerModel().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + public SBQueueImpl withMaxDeliveryCount(Integer maxDeliveryCount) { + this.innerModel().withMaxDeliveryCount(maxDeliveryCount); + return this; + } + + public SBQueueImpl withStatus(EntityStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public SBQueueImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.innerModel().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + public SBQueueImpl withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.innerModel().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + public SBQueueImpl withEnablePartitioning(Boolean enablePartitioning) { + this.innerModel().withEnablePartitioning(enablePartitioning); + return this; + } + + public SBQueueImpl withEnableExpress(Boolean enableExpress) { + this.innerModel().withEnableExpress(enableExpress); + return this; + } + + public SBQueueImpl withForwardTo(String forwardTo) { + this.innerModel().withForwardTo(forwardTo); + return this; + } + + public SBQueueImpl withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.innerModel().withForwardDeadLetteredMessagesTo(forwardDeadLetteredMessagesTo); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBSubscriptionImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBSubscriptionImpl.java new file mode 100644 index 0000000000000..83854e88eb81a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBSubscriptionImpl.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBClientAffineProperties; +import com.azure.resourcemanager.servicebus.generated.models.SBSubscription; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class SBSubscriptionImpl implements SBSubscription { + private SBSubscriptionInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + SBSubscriptionImpl( + SBSubscriptionInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Long messageCount() { + return this.innerModel().messageCount(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime accessedAt() { + return this.innerModel().accessedAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public MessageCountDetails countDetails() { + return this.innerModel().countDetails(); + } + + public Duration lockDuration() { + return this.innerModel().lockDuration(); + } + + public Boolean requiresSession() { + return this.innerModel().requiresSession(); + } + + public Duration defaultMessageTimeToLive() { + return this.innerModel().defaultMessageTimeToLive(); + } + + public Boolean deadLetteringOnFilterEvaluationExceptions() { + return this.innerModel().deadLetteringOnFilterEvaluationExceptions(); + } + + public Boolean deadLetteringOnMessageExpiration() { + return this.innerModel().deadLetteringOnMessageExpiration(); + } + + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerModel().duplicateDetectionHistoryTimeWindow(); + } + + public Integer maxDeliveryCount() { + return this.innerModel().maxDeliveryCount(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public Boolean enableBatchedOperations() { + return this.innerModel().enableBatchedOperations(); + } + + public Duration autoDeleteOnIdle() { + return this.innerModel().autoDeleteOnIdle(); + } + + public String forwardTo() { + return this.innerModel().forwardTo(); + } + + public String forwardDeadLetteredMessagesTo() { + return this.innerModel().forwardDeadLetteredMessagesTo(); + } + + public Boolean isClientAffine() { + return this.innerModel().isClientAffine(); + } + + public SBClientAffineProperties clientAffineProperties() { + return this.innerModel().clientAffineProperties(); + } + + public SBSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBTopicImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBTopicImpl.java new file mode 100644 index 0000000000000..bdb8e5853b353 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBTopicImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBTopic; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class SBTopicImpl implements SBTopic, SBTopic.Definition, SBTopic.Update { + private SBTopicInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Long sizeInBytes() { + return this.innerModel().sizeInBytes(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public OffsetDateTime accessedAt() { + return this.innerModel().accessedAt(); + } + + public Integer subscriptionCount() { + return this.innerModel().subscriptionCount(); + } + + public MessageCountDetails countDetails() { + return this.innerModel().countDetails(); + } + + public Duration defaultMessageTimeToLive() { + return this.innerModel().defaultMessageTimeToLive(); + } + + public Integer maxSizeInMegabytes() { + return this.innerModel().maxSizeInMegabytes(); + } + + public Long maxMessageSizeInKilobytes() { + return this.innerModel().maxMessageSizeInKilobytes(); + } + + public Boolean requiresDuplicateDetection() { + return this.innerModel().requiresDuplicateDetection(); + } + + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerModel().duplicateDetectionHistoryTimeWindow(); + } + + public Boolean enableBatchedOperations() { + return this.innerModel().enableBatchedOperations(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public Boolean supportOrdering() { + return this.innerModel().supportOrdering(); + } + + public Duration autoDeleteOnIdle() { + return this.innerModel().autoDeleteOnIdle(); + } + + public Boolean enablePartitioning() { + return this.innerModel().enablePartitioning(); + } + + public Boolean enableExpress() { + return this.innerModel().enableExpress(); + } + + public SBTopicInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String topicName; + + public SBTopicImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SBTopic create() { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBTopic create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, topicName, this.innerModel(), context) + .getValue(); + return this; + } + + SBTopicImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBTopicInner(); + this.serviceManager = serviceManager; + this.topicName = name; + } + + public SBTopicImpl update() { + return this; + } + + public SBTopic apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBTopic apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, topicName, this.innerModel(), context) + .getValue(); + return this; + } + + SBTopicImpl( + SBTopicInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.topicName = Utils.getValueFromIdByName(innerObject.id(), "topics"); + } + + public SBTopic refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .getWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE) + .getValue(); + return this; + } + + public SBTopic refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .getWithResponse(resourceGroupName, namespaceName, topicName, context) + .getValue(); + return this; + } + + public SBTopicImpl withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.innerModel().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + public SBTopicImpl withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.innerModel().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + public SBTopicImpl withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.innerModel().withMaxMessageSizeInKilobytes(maxMessageSizeInKilobytes); + return this; + } + + public SBTopicImpl withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.innerModel().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + public SBTopicImpl withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + this.innerModel().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + public SBTopicImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.innerModel().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + public SBTopicImpl withStatus(EntityStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public SBTopicImpl withSupportOrdering(Boolean supportOrdering) { + this.innerModel().withSupportOrdering(supportOrdering); + return this; + } + + public SBTopicImpl withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.innerModel().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + public SBTopicImpl withEnablePartitioning(Boolean enablePartitioning) { + this.innerModel().withEnablePartitioning(enablePartitioning); + return this; + } + + public SBTopicImpl withEnableExpress(Boolean enableExpress) { + this.innerModel().withEnableExpress(enableExpress); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientBuilder.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientBuilder.java new file mode 100644 index 0000000000000..cc8adb262faa7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ServiceBusManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ServiceBusManagementClientImpl.class}) +public final class ServiceBusManagementClientBuilder { + /* + * Subscription credentials that uniquely identify a Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ServiceBusManagementClientImpl with the provided parameters. + * + * @return an instance of ServiceBusManagementClientImpl. + */ + public ServiceBusManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ServiceBusManagementClientImpl client = + new ServiceBusManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientImpl.java new file mode 100644 index 0000000000000..61df525c40a8e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientImpl.java @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.servicebus.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.MigrationConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.OperationsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.QueuesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.RulesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.ServiceBusManagementClient; +import com.azure.resourcemanager.servicebus.generated.fluent.SubscriptionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.TopicsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ServiceBusManagementClientImpl type. */ +@ServiceClient(builder = ServiceBusManagementClientBuilder.class) +public final class ServiceBusManagementClientImpl implements ServiceBusManagementClient { + private final ClientLogger logger = new ClientLogger(ServiceBusManagementClientImpl.class); + + /** + * Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The NamespacesClient object to access its operations. */ + private final NamespacesClient namespaces; + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + public NamespacesClient getNamespaces() { + return this.namespaces; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The DisasterRecoveryConfigsClient object to access its operations. */ + private final DisasterRecoveryConfigsClient disasterRecoveryConfigs; + + /** + * Gets the DisasterRecoveryConfigsClient object to access its operations. + * + * @return the DisasterRecoveryConfigsClient object. + */ + public DisasterRecoveryConfigsClient getDisasterRecoveryConfigs() { + return this.disasterRecoveryConfigs; + } + + /** The MigrationConfigsClient object to access its operations. */ + private final MigrationConfigsClient migrationConfigs; + + /** + * Gets the MigrationConfigsClient object to access its operations. + * + * @return the MigrationConfigsClient object. + */ + public MigrationConfigsClient getMigrationConfigs() { + return this.migrationConfigs; + } + + /** The QueuesClient object to access its operations. */ + private final QueuesClient queues; + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + public QueuesClient getQueues() { + return this.queues; + } + + /** The TopicsClient object to access its operations. */ + private final TopicsClient topics; + + /** + * Gets the TopicsClient object to access its operations. + * + * @return the TopicsClient object. + */ + public TopicsClient getTopics() { + return this.topics; + } + + /** The RulesClient object to access its operations. */ + private final RulesClient rules; + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + public RulesClient getRules() { + return this.rules; + } + + /** The SubscriptionsClient object to access its operations. */ + private final SubscriptionsClient subscriptions; + + /** + * Gets the SubscriptionsClient object to access its operations. + * + * @return the SubscriptionsClient object. + */ + public SubscriptionsClient getSubscriptions() { + return this.subscriptions; + } + + /** + * Initializes an instance of ServiceBusManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials that uniquely identify a Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ServiceBusManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-06-01-preview"; + this.namespaces = new NamespacesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsClientImpl(this); + this.migrationConfigs = new MigrationConfigsClientImpl(this); + this.queues = new QueuesClientImpl(this); + this.topics = new TopicsClientImpl(this); + this.rules = new RulesClientImpl(this); + this.subscriptions = new SubscriptionsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsClientImpl.java new file mode 100644 index 0000000000000..c3bd402c283a3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsClientImpl.java @@ -0,0 +1,1029 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.SubscriptionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.azure.resourcemanager.servicebus.generated.models.SBSubscriptionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ +public final class SubscriptionsClientImpl implements SubscriptionsClient { + private final ClientLogger logger = new ClientLogger(SubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SubscriptionsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of SubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(SubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface SubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTopic( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBSubscriptionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTopicNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTopic( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTopic( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTopicAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top), + nextLink -> listByTopicNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTopicAsync( + String resourceGroupName, String namespaceName, String topicName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top), + nextLink -> listByTopicNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTopicAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top, context), + nextLink -> listByTopicNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByTopicAsync(resourceGroupName, namespaceName, topicName, skip, top)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + return new PagedIterable<>(listByTopicAsync(resourceGroupName, namespaceName, topicName, skip, top, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBSubscriptionInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, topicName, subscriptionName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + deleteAsync(resourceGroupName, namespaceName, topicName, subscriptionName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBSubscriptionInner get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return getAsync(resourceGroupName, namespaceName, topicName, subscriptionName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByTopicNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTopicNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsImpl.java new file mode 100644 index 0000000000000..a28952a60d84d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.SubscriptionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.azure.resourcemanager.servicebus.generated.models.SBSubscription; +import com.azure.resourcemanager.servicebus.generated.models.Subscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SubscriptionsImpl implements Subscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsImpl.class); + + private final SubscriptionsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public SubscriptionsImpl( + SubscriptionsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByTopic(String resourceGroupName, String namespaceName, String topicName) { + PagedIterable inner = + this.serviceClient().listByTopic(resourceGroupName, namespaceName, topicName); + return Utils.mapPage(inner, inner1 -> new SBSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByTopic(resourceGroupName, namespaceName, topicName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new SBSubscriptionImpl(inner1, this.manager())); + } + + public SBSubscription createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + SBSubscriptionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, namespaceName, topicName, subscriptionName, parameters); + if (inner != null) { + return new SBSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + this.serviceClient().delete(resourceGroupName, namespaceName, topicName, subscriptionName); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, context); + } + + public SBSubscription get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + SBSubscriptionInner inner = + this.serviceClient().get(resourceGroupName, namespaceName, topicName, subscriptionName); + if (inner != null) { + return new SBSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsClientImpl.java new file mode 100644 index 0000000000000..11113ea896805 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsClientImpl.java @@ -0,0 +1,2327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.TopicsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBTopicListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TopicsClient. */ +public final class TopicsClientImpl implements TopicsClient { + private final ClientLogger logger = new ClientLogger(TopicsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TopicsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of TopicsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TopicsClientImpl(ServiceBusManagementClientImpl client) { + this.service = RestProxy.create(TopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientTopics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + private interface TopicsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBAuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}" + + "/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBTopicInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String topicName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName, context)); + } + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .block(); + } + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByNamespace( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNamespace( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top, context), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, topicName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBTopicInner createOrUpdate( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, topicName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, topicName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, String topicName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String topicName) { + deleteAsync(resourceGroupName, namespaceName, topicName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String topicName) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBTopicInner get(String resourceGroupName, String namespaceName, String topicName) { + return getAsync(resourceGroupName, namespaceName, topicName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsImpl.java new file mode 100644 index 0000000000000..09ea1d7df5cb7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsImpl.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.TopicsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.azure.resourcemanager.servicebus.generated.models.SBTopic; +import com.azure.resourcemanager.servicebus.generated.models.Topics; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TopicsImpl implements Topics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopicsImpl.class); + + private final TopicsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public TopicsImpl( + TopicsClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, topicName); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, topicName, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .createOrUpdateAuthorizationRule( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + this + .serviceClient() + .deleteAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName); + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context); + } + + public AccessKeys listKeys( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + AccessKeysInner inner = + this.serviceClient().listKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, topicName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this + .serviceClient() + .regenerateKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SBTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByNamespace(resourceGroupName, namespaceName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new SBTopicImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String topicName) { + this.serviceClient().delete(resourceGroupName, namespaceName, topicName); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, topicName, context); + } + + public SBTopic get(String resourceGroupName, String namespaceName, String topicName) { + SBTopicInner inner = this.serviceClient().get(resourceGroupName, namespaceName, topicName); + if (inner != null) { + return new SBTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, topicName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBTopic getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, topicName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, topicName, context); + } + + private TopicsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public SBTopicImpl define(String name) { + return new SBTopicImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/Utils.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/Utils.java new file mode 100644 index 0000000000000..ec6fb7e7eeca7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/package-info.java new file mode 100644 index 0000000000000..c375b9e95db8c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for ServiceBusManagementClient. Azure Service Bus client for managing + * Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.implementation; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessKeys.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessKeys.java new file mode 100644 index 0000000000000..4b783e933dbe6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessKeys.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; + +/** An immutable client-side representation of AccessKeys. */ +public interface AccessKeys { + /** + * Gets the primaryConnectionString property: Primary connection string of the created namespace authorization rule. + * + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * Gets the secondaryConnectionString property: Secondary connection string of the created namespace authorization + * rule. + * + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * Gets the aliasPrimaryConnectionString property: Primary connection string of the alias if GEO DR is enabled. + * + * @return the aliasPrimaryConnectionString value. + */ + String aliasPrimaryConnectionString(); + + /** + * Gets the aliasSecondaryConnectionString property: Secondary connection string of the alias if GEO DR is enabled. + * + * @return the aliasSecondaryConnectionString value. + */ + String aliasSecondaryConnectionString(); + + /** + * Gets the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the keyName property: A string that describes the authorization rule. + * + * @return the keyName value. + */ + String keyName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner object. + * + * @return the inner object. + */ + AccessKeysInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessRights.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessRights.java new file mode 100644 index 0000000000000..487a03171a696 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessRights.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Action.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Action.java new file mode 100644 index 0000000000000..6c351b67609e8 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Action.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@Fluent +public class Action { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Action.class); + + /* + * 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 sqlExpression property: SQL expression. e.g. MyProperty='ABC'. + * + * @return the sqlExpression value. + */ + public String sqlExpression() { + return this.sqlExpression; + } + + /** + * Set the sqlExpression property: 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 the compatibilityLevel property: 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 the compatibilityLevel property: 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 the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value. + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set the requiresPreprocessing property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecovery.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecovery.java new file mode 100644 index 0000000000000..d5fb91f5b96aa --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecovery.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; + +/** An immutable client-side representation of ArmDisasterRecovery. */ +public interface ArmDisasterRecovery { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Alias(Disaster Recovery configuration) - possible + * values 'Accepted' or 'Succeeded' or 'Failed'. + * + * @return the provisioningState value. + */ + ProvisioningStateDR provisioningState(); + + /** + * Gets the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * Gets the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO + * DR pairing. + * + * @return the partnerNamespace value. + */ + String partnerNamespace(); + + /** + * Gets the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the alternateName value. + */ + String alternateName(); + + /** + * Gets the role property: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or + * 'Secondary'. + * + * @return the role value. + */ + RoleDisasterRecovery role(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner object. + * + * @return the inner object. + */ + ArmDisasterRecoveryInner innerModel(); + + /** The entirety of the ArmDisasterRecovery definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ArmDisasterRecovery definition stages. */ + interface DefinitionStages { + /** The first stage of the ArmDisasterRecovery definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ArmDisasterRecovery definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithPartnerNamespace, DefinitionStages.WithAlternateName { + /** + * Executes the create request. + * + * @return the created resource. + */ + ArmDisasterRecovery create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ArmDisasterRecovery create(Context context); + } + /** The stage of the ArmDisasterRecovery definition allowing to specify partnerNamespace. */ + interface WithPartnerNamespace { + /** + * Specifies the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which + * is part of GEO DR pairing. + * + * @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 ArmDisasterRecovery definition allowing to specify alternateName. */ + interface WithAlternateName { + /** + * Specifies the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * + * @param alternateName Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * @return the next definition stage. + */ + WithCreate withAlternateName(String alternateName); + } + } + /** + * Begins update for the ArmDisasterRecovery resource. + * + * @return the stage of resource update. + */ + ArmDisasterRecovery.Update update(); + + /** The template for ArmDisasterRecovery update. */ + interface Update extends UpdateStages.WithPartnerNamespace, UpdateStages.WithAlternateName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ArmDisasterRecovery apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ArmDisasterRecovery apply(Context context); + } + /** The ArmDisasterRecovery update stages. */ + interface UpdateStages { + /** The stage of the ArmDisasterRecovery update allowing to specify partnerNamespace. */ + interface WithPartnerNamespace { + /** + * Specifies the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which + * is part of GEO DR pairing. + * + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * @return the next definition stage. + */ + Update withPartnerNamespace(String partnerNamespace); + } + /** The stage of the ArmDisasterRecovery update allowing to specify alternateName. */ + interface WithAlternateName { + /** + * Specifies the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * + * @param alternateName Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * @return the next definition stage. + */ + Update withAlternateName(String alternateName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ArmDisasterRecovery refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ArmDisasterRecovery refresh(Context context); + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakPairing(); + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response breakPairingWithResponse(Context context); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failOver(); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response failOverWithResponse(FailoverProperties parameters, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecoveryListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecoveryListResult.java new file mode 100644 index 0000000000000..80cb6dd02c0c1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecoveryListResult.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the List Alias(Disaster Recovery configuration) operation. */ +@Fluent +public final class ArmDisasterRecoveryListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryListResult.class); + + /* + * List of Alias(Disaster Recovery configurations) + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of Alias(Disaster Recovery configuration) + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of Alias(Disaster Recovery configurations). + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Alias(Disaster Recovery configurations). + * + * @param value the value value to set. + * @return the ArmDisasterRecoveryListResult object itself. + */ + public ArmDisasterRecoveryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Alias(Disaster Recovery configuration). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailability.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailability.java new file mode 100644 index 0000000000000..c354326227dc4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailability.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a Check Name availability request properties. */ +@Fluent +public final class CheckNameAvailability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailability.class); + + /* + * 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 property: 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 property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckNameAvailability")); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailabilityResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..b13f229db8f04 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the message property: The detailed info regarding the reason associated with the namespace. + * + * @return the message value. + */ + String message(); + + /** + * Gets the nameAvailable property: Value indicating namespace is availability, true if the namespace is available; + * otherwise, false. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason for unavailability of a namespace. + * + * @return the reason value. + */ + UnavailableReason reason(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner + * object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ConnectionState.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ConnectionState.java new file mode 100644 index 0000000000000..6f657f1db0f1d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ConnectionState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ConnectionState information. */ +@Fluent +public final class ConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionState.class); + + /* + * Status of the connection. + */ + @JsonProperty(value = "status") + private PrivateLinkConnectionStatus status; + + /* + * Description of the connection state. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the status property: Status of the connection. + * + * @return the status value. + */ + public PrivateLinkConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the connection. + * + * @param status the status value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withStatus(PrivateLinkConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: Description of the connection state. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CorrelationFilter.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CorrelationFilter.java new file mode 100644 index 0000000000000..fd12de913ca4b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CorrelationFilter.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents the correlation filter expression. */ +@Fluent +public final class CorrelationFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CorrelationFilter.class); + + /* + * dictionary object for custom filters + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 the properties property: dictionary object for custom filters. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: 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 the correlationId property: Identifier of the correlation. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: 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 the messageId property: Identifier of the message. + * + * @return the messageId value. + */ + public String messageId() { + return this.messageId; + } + + /** + * Set the messageId property: 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 the to property: Address to send to. + * + * @return the to value. + */ + public String to() { + return this.to; + } + + /** + * Set the to property: 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 the replyTo property: Address of the queue to reply to. + * + * @return the replyTo value. + */ + public String replyTo() { + return this.replyTo; + } + + /** + * Set the replyTo property: 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 the label property: Application specific label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: 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 the sessionId property: Session identifier. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set the sessionId property: 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 the replyToSessionId property: Session identifier to reply to. + * + * @return the replyToSessionId value. + */ + public String replyToSessionId() { + return this.replyToSessionId; + } + + /** + * Set the replyToSessionId property: 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 the contentType property: Content type of the message. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: 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 the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value. + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set the requiresPreprocessing property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DefaultAction.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DefaultAction.java new file mode 100644 index 0000000000000..b921610ba4e1b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DefaultAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultAction. */ +public final class DefaultAction extends ExpandableStringEnum { + /** Static value Allow for DefaultAction. */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** Static value Deny for DefaultAction. */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** @return known DefaultAction values. */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DisasterRecoveryConfigs.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DisasterRecoveryConfigs.java new file mode 100644 index 0000000000000..9c9a87015a4b5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DisasterRecoveryConfigs.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DisasterRecoveryConfigs. */ +public interface DisasterRecoveryConfigs { + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters); + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Alias(Disaster Recovery configurations). + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String alias); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + ArmDisasterRecovery get(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakPairing(String resourceGroupName, String namespaceName, String alias); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response breakPairingWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failOver(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. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + AccessKeys listKeys(String resourceGroupName, String namespaceName, String alias, 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 alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + ArmDisasterRecovery getById(String id); + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ArmDisasterRecovery resource. + * + * @param name resource name. + * @return the first stage of the new ArmDisasterRecovery definition. + */ + ArmDisasterRecovery.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Encryption.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Encryption.java new file mode 100644 index 0000000000000..ee433d1a8a56b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Encryption.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties to configure Encryption. */ +@Fluent +public final class Encryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); + + /* + * Properties of KeyVault + */ + @JsonProperty(value = "keyVaultProperties") + private List keyVaultProperties; + + /* + * Enumerates the possible value of keySource for Encryption + */ + @JsonProperty(value = "keySource") + private KeySource keySource; + + /* + * Enable Infrastructure Encryption (Double Encryption) + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /** + * Get the keyVaultProperties property: Properties of KeyVault. + * + * @return the keyVaultProperties value. + */ + public List keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Properties of KeyVault. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(List keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the keySource property: Enumerates the possible value of keySource for Encryption. + * + * @return the keySource value. + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: Enumerates the possible value of keySource for Encryption. + * + * @param keySource the keySource value to set. + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: Enable Infrastructure Encryption (Double Encryption). + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: Enable Infrastructure Encryption (Double Encryption). + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EndPointProvisioningState.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EndPointProvisioningState.java new file mode 100644 index 0000000000000..604880925c01d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EndPointProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EntityStatus.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EntityStatus.java new file mode 100644 index 0000000000000..11d27fa956847 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EntityStatus.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FailoverProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FailoverProperties.java new file mode 100644 index 0000000000000..ba651ca8eaf96 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FailoverProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Safe failover is to indicate the service should wait for pending replication to finish before switching to the + * secondary. + */ +@JsonFlatten +@Fluent +public class FailoverProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FailoverProperties.class); + + /* + * Safe failover is to indicate the service should wait for pending + * replication to finish before switching to the secondary. + */ + @JsonProperty(value = "properties.IsSafeFailover") + private Boolean isSafeFailover; + + /** + * Get the isSafeFailover property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @return the isSafeFailover value. + */ + public Boolean isSafeFailover() { + return this.isSafeFailover; + } + + /** + * Set the isSafeFailover property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @param isSafeFailover the isSafeFailover value to set. + * @return the FailoverProperties object itself. + */ + public FailoverProperties withIsSafeFailover(Boolean isSafeFailover) { + this.isSafeFailover = isSafeFailover; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FilterType.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FilterType.java new file mode 100644 index 0000000000000..9115a76796d3e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FilterType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Identity.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Identity.java new file mode 100644 index 0000000000000..49ce6c49fa975 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Identity.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties to configure User Assigned Identities for Bring your Own Keys. */ +@Fluent +public class Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); + + /* + * ObjectId from the KeyVault + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * TenantId from the KeyVault + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Type of managed service identity. + */ + @JsonProperty(value = "type") + private ManagedServiceIdentityType type; + + /* + * Properties for User Assigned Identities + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: ObjectId from the KeyVault. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: TenantId from the KeyVault. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Properties for User Assigned Identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Properties for User Assigned Identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeySource.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeySource.java new file mode 100644 index 0000000000000..f19e5f4728e39 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeySource.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyType.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyType.java new file mode 100644 index 0000000000000..06d47cee4b54b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyVaultProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyVaultProperties.java new file mode 100644 index 0000000000000..07675c03a7e57 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyVaultProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties to configure keyVault Properties. */ +@Fluent +public final class KeyVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); + + /* + * Name of the Key from KeyVault + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * Uri of KeyVault + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /* + * Version of KeyVault + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private UserAssignedIdentityProperties identity; + + /** + * Get the keyName property: Name of the Key from KeyVault. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: 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 the keyVaultUri property: Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: 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; + } + + /** + * Get the keyVersion property: Version of KeyVault. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: Version of KeyVault. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public UserAssignedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentity(UserAssignedIdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ManagedServiceIdentityType.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..f45bab94debf1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ManagedServiceIdentityType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ManagedServiceIdentityType. */ +public enum ManagedServiceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ManagedServiceIdentityType instance. */ + private final String value; + + ManagedServiceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ManagedServiceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ManagedServiceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String value) { + ManagedServiceIdentityType[] items = ManagedServiceIdentityType.values(); + for (ManagedServiceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MessageCountDetails.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MessageCountDetails.java new file mode 100644 index 0000000000000..7004a09fb9c0b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MessageCountDetails.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Message Count Details. */ +@Immutable +public final class MessageCountDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MessageCountDetails.class); + + /* + * 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 the activeMessageCount property: Number of active messages in the queue, topic, or subscription. + * + * @return the activeMessageCount value. + */ + public Long activeMessageCount() { + return this.activeMessageCount; + } + + /** + * Get the deadLetterMessageCount property: Number of messages that are dead lettered. + * + * @return the deadLetterMessageCount value. + */ + public Long deadLetterMessageCount() { + return this.deadLetterMessageCount; + } + + /** + * Get the scheduledMessageCount property: Number of scheduled messages. + * + * @return the scheduledMessageCount value. + */ + public Long scheduledMessageCount() { + return this.scheduledMessageCount; + } + + /** + * Get the transferMessageCount property: Number of messages transferred to another queue, topic, or subscription. + * + * @return the transferMessageCount value. + */ + public Long transferMessageCount() { + return this.transferMessageCount; + } + + /** + * Get the transferDeadLetterMessageCount property: Number of messages transferred into dead letters. + * + * @return the transferDeadLetterMessageCount value. + */ + public Long transferDeadLetterMessageCount() { + return this.transferDeadLetterMessageCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigListResult.java new file mode 100644 index 0000000000000..359825e6e93f1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigListResult.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the List migrationConfigurations operation. */ +@Fluent +public final class MigrationConfigListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationConfigListResult.class); + + /* + * List of Migration Configs + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of migrationConfigurations + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of Migration Configs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Migration Configs. + * + * @param value the value value to set. + * @return the MigrationConfigListResult object itself. + */ + public MigrationConfigListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * migrationConfigurations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigProperties.java new file mode 100644 index 0000000000000..f7bc17cc1382d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigProperties.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; + +/** An immutable client-side representation of MigrationConfigProperties. */ +public interface MigrationConfigProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of Migration Configuration. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * Gets the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * + * @return the targetNamespace value. + */ + String targetNamespace(); + + /** + * Gets the postMigrationName property: Name to access Standard Namespace after migration. + * + * @return the postMigrationName value. + */ + String postMigrationName(); + + /** + * Gets the migrationState property: State in which Standard to Premium Migration is, possible values : Unknown, + * Reverting, Completing, Initiating, Syncing, Active. + * + * @return the migrationState value. + */ + String migrationState(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner + * object. + * + * @return the inner object. + */ + MigrationConfigPropertiesInner innerModel(); + + /** The entirety of the MigrationConfigProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The MigrationConfigProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the MigrationConfigProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the MigrationConfigProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 MigrationConfigProperties definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTargetNamespace, DefinitionStages.WithPostMigrationName { + /** + * Executes the create request. + * + * @return the created resource. + */ + MigrationConfigProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MigrationConfigProperties create(Context context); + } + /** The stage of the MigrationConfigProperties definition allowing to specify targetNamespace. */ + interface WithTargetNamespace { + /** + * Specifies the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, + * will be used for migration. + * + * @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 MigrationConfigProperties definition allowing to specify postMigrationName. */ + interface WithPostMigrationName { + /** + * Specifies the postMigrationName property: Name to access Standard Namespace after migration. + * + * @param postMigrationName Name to access Standard Namespace after migration. + * @return the next definition stage. + */ + WithCreate withPostMigrationName(String postMigrationName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MigrationConfigProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MigrationConfigProperties refresh(Context context); + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void completeMigration(); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response completeMigrationWithResponse(Context context); + + /** + * This operation reverts Migration. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(); + + /** + * This operation reverts Migration. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response revertWithResponse(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigs.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigs.java new file mode 100644 index 0000000000000..98839fe18994f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigs.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MigrationConfigs. */ +public interface MigrationConfigs { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations. + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + MigrationConfigProperties get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * 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 configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void completeMigration(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * 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 configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * Retrieves Migration Config. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + MigrationConfigProperties getById(String id); + + /** + * Retrieves Migration Config. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a MigrationConfiguration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MigrationConfigProperties resource. + * + * @param name resource name. + * @return the first stage of the new MigrationConfigProperties definition. + */ + MigrationConfigProperties.DefinitionStages.Blank define(MigrationConfigurationName name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigurationName.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigurationName.java new file mode 100644 index 0000000000000..99a44eecf1243 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigurationName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationConfigurationName. */ +public final class MigrationConfigurationName extends ExpandableStringEnum { + /** Static value $default for MigrationConfigurationName. */ + public static final MigrationConfigurationName DEFAULT = fromString("$default"); + + /** + * Creates or finds a MigrationConfigurationName from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationConfigurationName. + */ + @JsonCreator + public static MigrationConfigurationName fromString(String name) { + return fromString(name, MigrationConfigurationName.class); + } + + /** @return known MigrationConfigurationName values. */ + public static Collection values() { + return values(MigrationConfigurationName.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetIpRules.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetIpRules.java new file mode 100644 index 0000000000000..42d3e40e9737e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetIpRules.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of NetWorkRuleSet - IpRules resource. */ +@Fluent +public final class NWRuleSetIpRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NWRuleSetIpRules.class); + + /* + * IP Mask + */ + @JsonProperty(value = "ipMask") + private String ipMask; + + /* + * The IP Filter Action + */ + @JsonProperty(value = "action") + private NetworkRuleIpAction action; + + /** + * Get the ipMask property: IP Mask. + * + * @return the ipMask value. + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set the ipMask property: IP Mask. + * + * @param ipMask the ipMask value to set. + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get the action property: The IP Filter Action. + * + * @return the action value. + */ + public NetworkRuleIpAction action() { + return this.action; + } + + /** + * Set the action property: The IP Filter Action. + * + * @param action the action value to set. + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withAction(NetworkRuleIpAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetVirtualNetworkRules.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetVirtualNetworkRules.java new file mode 100644 index 0000000000000..e127aafed9e11 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetVirtualNetworkRules.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of VirtualNetworkRules - NetworkRules resource. */ +@Fluent +public final class NWRuleSetVirtualNetworkRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NWRuleSetVirtualNetworkRules.class); + + /* + * Subnet properties + */ + @JsonProperty(value = "subnet") + private Subnet subnet; + + /* + * Value that indicates whether to ignore missing VNet Service Endpoint + */ + @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** + * Get the subnet property: Subnet properties. + * + * @return the subnet value. + */ + public Subnet subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet properties. + * + * @param subnet the subnet value to set. + * @return the NWRuleSetVirtualNetworkRules object itself. + */ + public NWRuleSetVirtualNetworkRules withSubnet(Subnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the ignoreMissingVnetServiceEndpoint property: Value that indicates whether to ignore missing VNet Service + * Endpoint. + * + * @return the ignoreMissingVnetServiceEndpoint value. + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set the ignoreMissingVnetServiceEndpoint property: Value that indicates whether to ignore missing VNet Service + * Endpoint. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. + * @return the NWRuleSetVirtualNetworkRules object itself. + */ + public NWRuleSetVirtualNetworkRules withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Namespaces.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Namespaces.java new file mode 100644 index 0000000000000..77f629cb42d9d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Namespaces.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; + +/** Resource collection API of Namespaces. */ +public interface Namespaces { + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + PagedIterable list(); + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + SBNamespace getByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + NetworkRuleSet createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName); + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkRuleSet for a Namespace. + */ + Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets list of 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName); + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace. + */ + PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * 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 authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * 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 authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + AccessKeys listKeys(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context); + + /** + * Gets a description for the specified namespace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + SBNamespace getById(String id); + + /** + * Gets a description for the specified namespace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + SBAuthorizationRule getAuthorizationRuleById(String id); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + Response getAuthorizationRuleByIdWithResponse(String id, Context context); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Deletes a namespace authorization rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRuleById(String id); + + /** + * Deletes a namespace authorization rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SBNamespace resource. + * + * @param name resource name. + * @return the first stage of the new SBNamespace definition. + */ + SBNamespace.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new SBAuthorizationRule resource. + * + * @param name resource name. + * @return the first stage of the new SBAuthorizationRule definition. + */ + SBAuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleIpAction.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleIpAction.java new file mode 100644 index 0000000000000..3db233e022adf --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleIpAction.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkRuleIpAction. */ +public final class NetworkRuleIpAction extends ExpandableStringEnum { + /** Static value Allow for NetworkRuleIpAction. */ + public static final NetworkRuleIpAction ALLOW = fromString("Allow"); + + /** + * Creates or finds a NetworkRuleIpAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkRuleIpAction. + */ + @JsonCreator + public static NetworkRuleIpAction fromString(String name) { + return fromString(name, NetworkRuleIpAction.class); + } + + /** @return known NetworkRuleIpAction values. */ + public static Collection values() { + return values(NetworkRuleIpAction.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSet.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..20a6b037ed369 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSet.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import java.util.List; + +/** An immutable client-side representation of NetworkRuleSet. */ +public interface NetworkRuleSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + Boolean trustedServiceAccessEnabled(); + + /** + * Gets the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + DefaultAction defaultAction(); + + /** + * Gets the virtualNetworkRules property: List VirtualNetwork Rules. + * + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + + /** + * Gets the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + List ipRules(); + + /** + * Gets the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it + * is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccessFlag publicNetworkAccess(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner object. + * + * @return the inner object. + */ + NetworkRuleSetInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSetListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSetListResult.java new file mode 100644 index 0000000000000..318129ad4cc89 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSetListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List NetworkRuleSet operation. */ +@Fluent +public final class NetworkRuleSetListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetListResult.class); + + /* + * Result of the List NetworkRuleSet operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of NetworkRuleSet. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List NetworkRuleSet operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List NetworkRuleSet operation. + * + * @param value the value value to set. + * @return the NetworkRuleSetListResult object itself. + */ + public NetworkRuleSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @param nextLink the nextLink value to set. + * @return the NetworkRuleSetListResult object itself. + */ + public NetworkRuleSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operation.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operation.java new file mode 100644 index 0000000000000..92d61cf6ffa46 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operation.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationDisplay.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..cffb3758e22dc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationDisplay.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft.ServiceBus + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Resource on which the operation is performed: Invoice, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Get the provider property: Service provider: Microsoft.ServiceBus. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Resource on which the operation is performed: Invoice, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..c9a2a591e4674 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationListResult.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list ServiceBus operations. It contains a list of operations and a URL link to get the next + * set of results. + */ +@Immutable +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of ServiceBus operations supported by the Microsoft.ServiceBus + * resource provider. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of ServiceBus operations supported by the Microsoft.ServiceBus resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operations.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operations.java new file mode 100644 index 0000000000000..e785db3b2e1a1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + PagedIterable list(); + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpoint.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..a4186d3ef5438 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpoint.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpoint information. */ +@Fluent +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnection.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..537a3f1dcdda2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value. + */ + ConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + EndPointProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, + DefinitionStages.WithPrivateLinkServiceConnectionState, + DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The Private Endpoint resource for this Connection.. + * + * @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 the privateLinkServiceConnectionState property: Details about the state of the connection.. + * + * @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 the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + WithCreate withProvisioningState(EndPointProvisioningState provisioningState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update + extends UpdateStages.WithPrivateEndpoint, + UpdateStages.WithPrivateLinkServiceConnectionState, + UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The Private Endpoint resource for this Connection.. + * + * @param privateEndpoint The Private Endpoint resource for this Connection. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Details about the state of the connection.. + * + * @param privateLinkServiceConnectionState Details about the state of the connection. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + /** The stage of the PrivateEndpointConnection update allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + Update withProvisioningState(EndPointProvisioningState provisioningState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnectionListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..c9c2c6109ef6a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the list of all private endpoint connections operation. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * A collection of private endpoint connection resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of private endpoint connection resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of private endpoint connection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private endpoint connection resources. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of private endpoint connection resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of private endpoint connection resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnections.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..6d87804484115 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace. + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkConnectionStatus.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkConnectionStatus.java new file mode 100644 index 0000000000000..0102d13386bb9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResource.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..b7f9b27059236 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResource.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information of the private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); + + /* + * 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; + + /* + * 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; + + /** + * Get the id property: Fully qualified identifier of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified identifier of the resource. + * + * @param id the id value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource. + * + * @param type the type value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withType(String type) { + this.type = type; + return this; + } + + /** + * Get the groupId property: The groupId property. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The groupId property. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: Required Members. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: Required Members. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: Required Zone Names. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: Required Zone Names. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResources.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..e54e483c184c5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + PrivateLinkResourcesListResult get(String resourceGroupName, String namespaceName); + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResourcesListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResourcesListResult.java new file mode 100644 index 0000000000000..39bc1bfe18e1a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResourcesListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourcesListResult. */ +public interface PrivateLinkResourcesListResult { + /** + * Gets the value property: A collection of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: A link for the next page of private link resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourcesListResultInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ProvisioningStateDR.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ProvisioningStateDR.java new file mode 100644 index 0000000000000..161c1d43f2046 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ProvisioningStateDR.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccessFlag.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccessFlag.java new file mode 100644 index 0000000000000..ca9a7a299442b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccessFlag.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccessFlag. */ +public final class PublicNetworkAccessFlag extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccessFlag. */ + public static final PublicNetworkAccessFlag ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccessFlag. */ + public static final PublicNetworkAccessFlag DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccessFlag from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccessFlag. + */ + @JsonCreator + public static PublicNetworkAccessFlag fromString(String name) { + return fromString(name, PublicNetworkAccessFlag.class); + } + + /** @return known PublicNetworkAccessFlag values. */ + public static Collection values() { + return values(PublicNetworkAccessFlag.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Queues.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Queues.java new file mode 100644 index 0000000000000..69869fe78cb20 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Queues.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; + +/** Resource collection API of Queues. */ +public interface Queues { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys listKeys(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace. + */ + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String queueName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + SBQueue get(String resourceGroupName, String namespaceName, String queueName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * Returns a description for the specified queue. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + SBQueue getById(String id); + + /** + * Returns a description for the specified queue. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SBQueue resource. + * + * @param name resource name. + * @return the first stage of the new SBQueue definition. + */ + SBQueue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RegenerateAccessKeyParameters.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RegenerateAccessKeyParameters.java new file mode 100644 index 0000000000000..b2c3d6d074a40 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RegenerateAccessKeyParameters.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. */ +@Fluent +public final class RegenerateAccessKeyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateAccessKeyParameters.class); + + /* + * The access key to regenerate. + */ + @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 keyType property: The access key to regenerate. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The access key to regenerate. + * + * @param keyType the keyType value to set. + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get the key property: 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 the key property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model RegenerateAccessKeyParameters")); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ResourceNamespacePatch.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ResourceNamespacePatch.java new file mode 100644 index 0000000000000..91fe2e87d4d87 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ResourceNamespacePatch.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Resource definition. */ +@Fluent +public class ResourceNamespacePatch extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNamespacePatch.class); + + /* + * Resource location + */ + @JsonProperty(value = "location") + private String location; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the ResourceNamespacePatch object itself. + */ + public ResourceNamespacePatch withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ResourceNamespacePatch object itself. + */ + public ResourceNamespacePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RoleDisasterRecovery.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RoleDisasterRecovery.java new file mode 100644 index 0000000000000..f07eaa583587e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RoleDisasterRecovery.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rule.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rule.java new file mode 100644 index 0000000000000..0f537132921d0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rule.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; + +/** An immutable client-side representation of Rule. */ +public interface Rule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the action property: 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. + */ + Action action(); + + /** + * Gets the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @return the filterType value. + */ + FilterType filterType(); + + /** + * Gets the sqlFilter property: Properties of sqlFilter. + * + * @return the sqlFilter value. + */ + SqlFilter sqlFilter(); + + /** + * Gets the correlationFilter property: Properties of correlationFilter. + * + * @return the correlationFilter value. + */ + CorrelationFilter correlationFilter(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner object. + * + * @return the inner object. + */ + RuleInner innerModel(); + + /** The entirety of the Rule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + /** The Rule definition stages. */ + interface DefinitionStages { + /** The first stage of the Rule definition. */ + interface Blank extends WithResourceGroup { + } + /** The stage of the Rule definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * 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 withExistingResourceGroup( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + } + /** + * The stage of the Rule definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithAction, + DefinitionStages.WithFilterType, + DefinitionStages.WithSqlFilter, + DefinitionStages.WithCorrelationFilter { + /** + * Executes the create request. + * + * @return the created resource. + */ + Rule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Rule create(Context context); + } + /** The stage of the Rule definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: Represents the filter actions which are allowed for the transformation of + * a message that have been matched by a filter expression.. + * + * @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 filterType. */ + interface WithFilterType { + /** + * Specifies the filterType property: Filter type that is evaluated against a BrokeredMessage.. + * + * @param filterType Filter type that is evaluated against a BrokeredMessage. + * @return the next definition stage. + */ + WithCreate withFilterType(FilterType filterType); + } + /** The stage of the Rule definition allowing to specify sqlFilter. */ + interface WithSqlFilter { + /** + * Specifies the sqlFilter property: Properties of sqlFilter. + * + * @param sqlFilter Properties of sqlFilter. + * @return the next definition stage. + */ + WithCreate withSqlFilter(SqlFilter sqlFilter); + } + /** The stage of the Rule definition allowing to specify correlationFilter. */ + interface WithCorrelationFilter { + /** + * Specifies the correlationFilter property: Properties of correlationFilter. + * + * @param correlationFilter Properties of correlationFilter. + * @return the next definition stage. + */ + WithCreate withCorrelationFilter(CorrelationFilter correlationFilter); + } + } + /** + * Begins update for the Rule resource. + * + * @return the stage of resource update. + */ + Rule.Update update(); + + /** The template for Rule update. */ + interface Update + extends UpdateStages.WithAction, + UpdateStages.WithFilterType, + UpdateStages.WithSqlFilter, + UpdateStages.WithCorrelationFilter { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Rule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Rule apply(Context context); + } + /** The Rule update stages. */ + interface UpdateStages { + /** The stage of the Rule update allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: Represents the filter actions which are allowed for the transformation of + * a message that have been matched by a filter expression.. + * + * @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. + */ + Update withAction(Action action); + } + /** The stage of the Rule update allowing to specify filterType. */ + interface WithFilterType { + /** + * Specifies the filterType property: Filter type that is evaluated against a BrokeredMessage.. + * + * @param filterType Filter type that is evaluated against a BrokeredMessage. + * @return the next definition stage. + */ + Update withFilterType(FilterType filterType); + } + /** The stage of the Rule update allowing to specify sqlFilter. */ + interface WithSqlFilter { + /** + * Specifies the sqlFilter property: Properties of sqlFilter. + * + * @param sqlFilter Properties of sqlFilter. + * @return the next definition stage. + */ + Update withSqlFilter(SqlFilter sqlFilter); + } + /** The stage of the Rule update allowing to specify correlationFilter. */ + interface WithCorrelationFilter { + /** + * Specifies the correlationFilter property: Properties of correlationFilter. + * + * @param correlationFilter Properties of correlationFilter. + * @return the next definition stage. + */ + Update withCorrelationFilter(CorrelationFilter correlationFilter); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Rule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Rule refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RuleListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RuleListResult.java new file mode 100644 index 0000000000000..6ec38041341cd --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RuleListResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List rule operation. */ +@Fluent +public final class RuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleListResult.class); + + /* + * Result of the List Rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of rules + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Rules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Rules operation. + * + * @param value the value value to set. + * @return the RuleListResult object itself. + */ + public RuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of rules. + * + * @param nextLink the nextLink value to set. + * @return the RuleListResult object itself. + */ + public RuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rules.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rules.java new file mode 100644 index 0000000000000..dc58a28fee60c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rules.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Rules. */ +public interface Rules { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation. + */ + PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + Rule get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * Retrieves the description for the specified rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + Rule getById(String id); + + /** + * Retrieves the description for the specified rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Rule resource. + * + * @param name resource name. + * @return the first stage of the new Rule definition. + */ + Rule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRule.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRule.java new file mode 100644 index 0000000000000..c7bd95efa2ddd --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRule.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import java.util.List; + +/** An immutable client-side representation of SBAuthorizationRule. */ +public interface SBAuthorizationRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the rights property: The rights associated with the rule. + * + * @return the rights value. + */ + List rights(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner object. + * + * @return the inner object. + */ + SBAuthorizationRuleInner innerModel(); + + /** The entirety of the SBAuthorizationRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SBAuthorizationRule definition stages. */ + interface DefinitionStages { + /** The first stage of the SBAuthorizationRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SBAuthorizationRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 SBAuthorizationRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithRights { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBAuthorizationRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBAuthorizationRule create(Context context); + } + /** The stage of the SBAuthorizationRule definition allowing to specify rights. */ + interface WithRights { + /** + * Specifies the rights property: The rights associated with the rule.. + * + * @param rights The rights associated with the rule. + * @return the next definition stage. + */ + WithCreate withRights(List rights); + } + } + /** + * Begins update for the SBAuthorizationRule resource. + * + * @return the stage of resource update. + */ + SBAuthorizationRule.Update update(); + + /** The template for SBAuthorizationRule update. */ + interface Update extends UpdateStages.WithRights { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBAuthorizationRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBAuthorizationRule apply(Context context); + } + /** The SBAuthorizationRule update stages. */ + interface UpdateStages { + /** The stage of the SBAuthorizationRule update allowing to specify rights. */ + interface WithRights { + /** + * Specifies the rights property: The rights associated with the rule.. + * + * @param rights The rights associated with the rule. + * @return the next definition stage. + */ + Update withRights(List rights); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBAuthorizationRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBAuthorizationRule refresh(Context context); + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + AccessKeys listKeys(); + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the namespace. + */ + Response listKeysWithResponse(Context context); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRuleListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRuleListResult.java new file mode 100644 index 0000000000000..7bbf68a28c72b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRuleListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Namespace operation. */ +@Fluent +public final class SBAuthorizationRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBAuthorizationRuleListResult.class); + + /* + * Result of the List Authorization Rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of Authorization Rules. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Authorization Rules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Authorization Rules operation. + * + * @param value the value value to set. + * @return the SBAuthorizationRuleListResult object itself. + */ + public SBAuthorizationRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Authorization Rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Authorization Rules. + * + * @param nextLink the nextLink value to set. + * @return the SBAuthorizationRuleListResult object itself. + */ + public SBAuthorizationRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBClientAffineProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBClientAffineProperties.java new file mode 100644 index 0000000000000..8483777ba86ef --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBClientAffineProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties specific to client affine subscriptions. */ +@Fluent +public final class SBClientAffineProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBClientAffineProperties.class); + + /* + * Indicates the Client ID of the application that created the + * client-affine subscription. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * For client-affine subscriptions, this value indicates whether the + * subscription is durable or not. + */ + @JsonProperty(value = "isDurable") + private Boolean isDurable; + + /* + * For client-affine subscriptions, this value indicates whether the + * subscription is shared or not. + */ + @JsonProperty(value = "isShared") + private Boolean isShared; + + /** + * Get the clientId property: Indicates the Client ID of the application that created the client-affine + * subscription. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Indicates the Client ID of the application that created the client-affine + * subscription. + * + * @param clientId the clientId value to set. + * @return the SBClientAffineProperties object itself. + */ + public SBClientAffineProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the isDurable property: For client-affine subscriptions, this value indicates whether the subscription is + * durable or not. + * + * @return the isDurable value. + */ + public Boolean isDurable() { + return this.isDurable; + } + + /** + * Set the isDurable property: For client-affine subscriptions, this value indicates whether the subscription is + * durable or not. + * + * @param isDurable the isDurable value to set. + * @return the SBClientAffineProperties object itself. + */ + public SBClientAffineProperties withIsDurable(Boolean isDurable) { + this.isDurable = isDurable; + return this; + } + + /** + * Get the isShared property: For client-affine subscriptions, this value indicates whether the subscription is + * shared or not. + * + * @return the isShared value. + */ + public Boolean isShared() { + return this.isShared; + } + + /** + * Set the isShared property: For client-affine subscriptions, this value indicates whether the subscription is + * shared or not. + * + * @param isShared the isShared value to set. + * @return the SBClientAffineProperties object itself. + */ + public SBClientAffineProperties withIsShared(Boolean isShared) { + this.isShared = isShared; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespace.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespace.java new file mode 100644 index 0000000000000..1cf799426c080 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespace.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SBNamespace. */ +public interface SBNamespace { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: Properties of SKU. + * + * @return the sku value. + */ + SBSku sku(); + + /** + * Gets the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the namespace. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: Status of the namespace. + * + * @return the status value. + */ + String status(); + + /** + * Gets the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * Gets the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + String metricId(); + + /** + * Gets the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @return the zoneRedundant value. + */ + Boolean zoneRedundant(); + + /** + * Gets the encryption property: Properties of BYOK Encryption description. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + Boolean disableLocalAuth(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner object. + * + * @return the inner object. + */ + SBNamespaceInner innerModel(); + + /** The entirety of the SBNamespace definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SBNamespace definition stages. */ + interface DefinitionStages { + /** The first stage of the SBNamespace definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SBNamespace definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SBNamespace definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SBNamespace definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithIdentity, + DefinitionStages.WithZoneRedundant, + DefinitionStages.WithEncryption, + DefinitionStages.WithPrivateEndpointConnections, + DefinitionStages.WithDisableLocalAuth { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBNamespace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBNamespace create(Context context); + } + /** The stage of the SBNamespace definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SBNamespace definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of SKU. + * + * @param sku Properties of SKU. + * @return the next definition stage. + */ + WithCreate withSku(SBSku sku); + } + /** The stage of the SBNamespace definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Properties of BYOK Identity description. + * + * @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 zoneRedundant. */ + interface WithZoneRedundant { + /** + * Specifies the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in + * regions supported availability zones.. + * + * @param zoneRedundant Enabling this property creates a Premium Service Bus Namespace in regions supported + * availability zones. + * @return the next definition stage. + */ + WithCreate withZoneRedundant(Boolean zoneRedundant); + } + /** The stage of the SBNamespace definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Properties of BYOK Encryption description. + * + * @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 privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the SBNamespace definition allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This property disables SAS authentication for the Service Bus + * namespace.. + * + * @param disableLocalAuth This property disables SAS authentication for the Service Bus namespace. + * @return the next definition stage. + */ + WithCreate withDisableLocalAuth(Boolean disableLocalAuth); + } + } + /** + * Begins update for the SBNamespace resource. + * + * @return the stage of resource update. + */ + SBNamespace.Update update(); + + /** The template for SBNamespace update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithZoneRedundant, + UpdateStages.WithEncryption, + UpdateStages.WithPrivateEndpointConnections, + UpdateStages.WithDisableLocalAuth { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBNamespace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBNamespace apply(Context context); + } + /** The SBNamespace update stages. */ + interface UpdateStages { + /** The stage of the SBNamespace update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SBNamespace update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of SKU. + * + * @param sku Properties of SKU. + * @return the next definition stage. + */ + Update withSku(SBSku sku); + } + /** The stage of the SBNamespace update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Properties of BYOK Identity description. + * + * @param identity Properties of BYOK Identity description. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + /** The stage of the SBNamespace update allowing to specify zoneRedundant. */ + interface WithZoneRedundant { + /** + * Specifies the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in + * regions supported availability zones.. + * + * @param zoneRedundant Enabling this property creates a Premium Service Bus Namespace in regions supported + * availability zones. + * @return the next definition stage. + */ + Update withZoneRedundant(Boolean zoneRedundant); + } + /** The stage of the SBNamespace update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Properties of BYOK Encryption description. + * + * @param encryption Properties of BYOK Encryption description. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + /** The stage of the SBNamespace update allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + Update withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the SBNamespace update allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This property disables SAS authentication for the Service Bus + * namespace.. + * + * @param disableLocalAuth This property disables SAS authentication for the Service Bus namespace. + * @return the next definition stage. + */ + Update withDisableLocalAuth(Boolean disableLocalAuth); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBNamespace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBNamespace refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceListResult.java new file mode 100644 index 0000000000000..1e50908d8f592 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List Namespace operation. */ +@Fluent +public final class SBNamespaceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBNamespaceListResult.class); + + /* + * Result of the List Namespace operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of Namespaces. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Namespace operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Namespace operation. + * + * @param value the value value to set. + * @return the SBNamespaceListResult object itself. + */ + public SBNamespaceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Namespaces. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Namespaces. + * + * @param nextLink the nextLink value to set. + * @return the SBNamespaceListResult object itself. + */ + public SBNamespaceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceUpdateParameters.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceUpdateParameters.java new file mode 100644 index 0000000000000..37efe03563d1e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceUpdateParameters.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Description of a namespace resource. */ +@JsonFlatten +@Fluent +public class SBNamespaceUpdateParameters extends ResourceNamespacePatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBNamespaceUpdateParameters.class); + + /* + * Properties of SKU + */ + @JsonProperty(value = "sku") + private SBSku sku; + + /* + * Properties of BYOK Identity description + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * Provisioning state of the namespace. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Status of the namespace. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The time the namespace was created + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The time the namespace was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Endpoint you can use to perform Service Bus operations. + */ + @JsonProperty(value = "properties.serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceBusEndpoint; + + /* + * Identifier for Azure Insights metrics + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Enabling this property creates a Premium Service Bus Namespace in + * regions supported availability zones. + */ + @JsonProperty(value = "properties.zoneRedundant") + private Boolean zoneRedundant; + + /* + * Properties of BYOK Encryption description + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * List of private endpoint connections. + */ + @JsonProperty(value = "properties.privateEndpointConnections") + private List privateEndpointConnections; + + /* + * This property disables SAS authentication for the Service Bus namespace. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /** + * Get the sku property: Properties of SKU. + * + * @return the sku value. + */ + public SBSku sku() { + return this.sku; + } + + /** + * Set the sku property: Properties of SKU. + * + * @param sku the sku value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withSku(SBSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: 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; + } + + /** + * Get the provisioningState property: Provisioning state of the namespace. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the namespace. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withZoneRedundant(Boolean zoneRedundant) { + this.zoneRedundant = zoneRedundant; + return this; + } + + /** + * Get the encryption property: Properties of BYOK Encryption description. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: 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 the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceUpdateParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueue.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueue.java new file mode 100644 index 0000000000000..e7270083945f6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueue.java @@ -0,0 +1,708 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SBQueue. */ +public interface SBQueue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the countDetails property: Message Count Details. + * + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * Gets the createdAt property: The exact time the message was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the accessedAt property: Last time a message was sent, or the last time there was a receive request to this + * queue. + * + * @return the accessedAt value. + */ + OffsetDateTime accessedAt(); + + /** + * Gets the sizeInBytes property: The size of the queue, in bytes. + * + * @return the sizeInBytes value. + */ + Long sizeInBytes(); + + /** + * Gets the messageCount property: The number of messages in the queue. + * + * @return the messageCount value. + */ + Long messageCount(); + + /** + * Gets the lockDuration property: 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. + */ + Duration lockDuration(); + + /** + * Gets the maxSizeInMegabytes property: 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. + */ + Integer maxSizeInMegabytes(); + + /** + * Gets the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + Long maxMessageSizeInKilobytes(); + + /** + * Gets the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + Boolean requiresDuplicateDetection(); + + /** + * Gets the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @return the requiresSession value. + */ + Boolean requiresSession(); + + /** + * Gets the defaultMessageTimeToLive property: 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. + */ + Duration defaultMessageTimeToLive(); + + /** + * Gets the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + Boolean deadLetteringOnMessageExpiration(); + + /** + * Gets the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Duration duplicateDetectionHistoryTimeWindow(); + + /** + * Gets the maxDeliveryCount property: The maximum delivery count. A message is automatically deadlettered after + * this number of deliveries. default value is 10. + * + * @return the maxDeliveryCount value. + */ + Integer maxDeliveryCount(); + + /** + * Gets the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * Gets the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + Duration autoDeleteOnIdle(); + + /** + * Gets the enablePartitioning property: A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + * + * @return the enablePartitioning value. + */ + Boolean enablePartitioning(); + + /** + * Gets the enableExpress property: 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. + */ + Boolean enableExpress(); + + /** + * Gets the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + String forwardTo(); + + /** + * Gets the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + String forwardDeadLetteredMessagesTo(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner object. + * + * @return the inner object. + */ + SBQueueInner innerModel(); + + /** The entirety of the SBQueue definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SBQueue definition stages. */ + interface DefinitionStages { + /** The first stage of the SBQueue definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SBQueue definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLockDuration, + DefinitionStages.WithMaxSizeInMegabytes, + DefinitionStages.WithMaxMessageSizeInKilobytes, + DefinitionStages.WithRequiresDuplicateDetection, + DefinitionStages.WithRequiresSession, + DefinitionStages.WithDefaultMessageTimeToLive, + DefinitionStages.WithDeadLetteringOnMessageExpiration, + DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, + DefinitionStages.WithMaxDeliveryCount, + DefinitionStages.WithStatus, + DefinitionStages.WithEnableBatchedOperations, + DefinitionStages.WithAutoDeleteOnIdle, + DefinitionStages.WithEnablePartitioning, + DefinitionStages.WithEnableExpress, + DefinitionStages.WithForwardTo, + DefinitionStages.WithForwardDeadLetteredMessagesTo { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBQueue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBQueue create(Context context); + } + /** The stage of the SBQueue definition allowing to specify lockDuration. */ + interface WithLockDuration { + /** + * Specifies the lockDuration property: 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 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(Duration lockDuration); + } + /** The stage of the SBQueue definition allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size + * of memory allocated for the queue. Default is 1024.. + * + * @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 maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the queue. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * queue. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + WithCreate withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBQueue definition allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: A value indicating if this queue requires duplicate + * detection.. + * + * @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 the requiresSession property: A value that indicates whether the queue supports the concept of + * sessions.. + * + * @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 defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: 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 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(Duration defaultMessageTimeToLive); + } + /** The stage of the SBQueue definition allowing to specify deadLetteringOnMessageExpiration. */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has + * dead letter support when a message expires.. + * + * @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 duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @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(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBQueue definition allowing to specify maxDeliveryCount. */ + interface WithMaxDeliveryCount { + /** + * Specifies the maxDeliveryCount property: The maximum delivery count. A message is automatically + * deadlettered after this number of deliveries. default value is 10.. + * + * @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 status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + WithCreate withStatus(EntityStatus status); + } + /** The stage of the SBQueue definition allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @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 autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @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(Duration autoDeleteOnIdle); + } + /** The stage of the SBQueue definition allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: A value that indicates whether the queue is to be partitioned + * across multiple message brokers.. + * + * @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 enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: 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 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 forwardTo. */ + interface WithForwardTo { + /** + * Specifies the forwardTo property: Queue/Topic name to forward the messages. + * + * @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 forwardDeadLetteredMessagesTo. */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter + * message. + * + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message. + * @return the next definition stage. + */ + WithCreate withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + } + /** + * Begins update for the SBQueue resource. + * + * @return the stage of resource update. + */ + SBQueue.Update update(); + + /** The template for SBQueue update. */ + interface Update + extends UpdateStages.WithLockDuration, + UpdateStages.WithMaxSizeInMegabytes, + UpdateStages.WithMaxMessageSizeInKilobytes, + UpdateStages.WithRequiresDuplicateDetection, + UpdateStages.WithRequiresSession, + UpdateStages.WithDefaultMessageTimeToLive, + UpdateStages.WithDeadLetteringOnMessageExpiration, + UpdateStages.WithDuplicateDetectionHistoryTimeWindow, + UpdateStages.WithMaxDeliveryCount, + UpdateStages.WithStatus, + UpdateStages.WithEnableBatchedOperations, + UpdateStages.WithAutoDeleteOnIdle, + UpdateStages.WithEnablePartitioning, + UpdateStages.WithEnableExpress, + UpdateStages.WithForwardTo, + UpdateStages.WithForwardDeadLetteredMessagesTo { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBQueue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBQueue apply(Context context); + } + /** The SBQueue update stages. */ + interface UpdateStages { + /** The stage of the SBQueue update allowing to specify lockDuration. */ + interface WithLockDuration { + /** + * Specifies the lockDuration property: 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 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. + */ + Update withLockDuration(Duration lockDuration); + } + /** The stage of the SBQueue update allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size + * of memory allocated for the queue. Default is 1024.. + * + * @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. + */ + Update withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + /** The stage of the SBQueue update allowing to specify maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the queue. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * queue. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + Update withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBQueue update allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: A value indicating if this queue requires duplicate + * detection.. + * + * @param requiresDuplicateDetection A value indicating if this queue requires duplicate detection. + * @return the next definition stage. + */ + Update withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + /** The stage of the SBQueue update allowing to specify requiresSession. */ + interface WithRequiresSession { + /** + * Specifies the requiresSession property: A value that indicates whether the queue supports the concept of + * sessions.. + * + * @param requiresSession A value that indicates whether the queue supports the concept of sessions. + * @return the next definition stage. + */ + Update withRequiresSession(Boolean requiresSession); + } + /** The stage of the SBQueue update allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: 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 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. + */ + Update withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive); + } + /** The stage of the SBQueue update allowing to specify deadLetteringOnMessageExpiration. */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has + * dead letter support when a message expires.. + * + * @param deadLetteringOnMessageExpiration A value that indicates whether this queue has dead letter support + * when a message expires. + * @return the next definition stage. + */ + Update withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + /** The stage of the SBQueue update allowing to specify duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @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. + */ + Update withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBQueue update allowing to specify maxDeliveryCount. */ + interface WithMaxDeliveryCount { + /** + * Specifies the maxDeliveryCount property: The maximum delivery count. A message is automatically + * deadlettered after this number of deliveries. default value is 10.. + * + * @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. + */ + Update withMaxDeliveryCount(Integer maxDeliveryCount); + } + /** The stage of the SBQueue update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + Update withStatus(EntityStatus status); + } + /** The stage of the SBQueue update allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled. + * @return the next definition stage. + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + /** The stage of the SBQueue update allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @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. + */ + Update withAutoDeleteOnIdle(Duration autoDeleteOnIdle); + } + /** The stage of the SBQueue update allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: A value that indicates whether the queue is to be partitioned + * across multiple message brokers.. + * + * @param enablePartitioning A value that indicates whether the queue is to be partitioned across multiple + * message brokers. + * @return the next definition stage. + */ + Update withEnablePartitioning(Boolean enablePartitioning); + } + /** The stage of the SBQueue update allowing to specify enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: 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 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. + */ + Update withEnableExpress(Boolean enableExpress); + } + /** The stage of the SBQueue update allowing to specify forwardTo. */ + interface WithForwardTo { + /** + * Specifies the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo Queue/Topic name to forward the messages. + * @return the next definition stage. + */ + Update withForwardTo(String forwardTo); + } + /** The stage of the SBQueue update allowing to specify forwardDeadLetteredMessagesTo. */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter + * message. + * + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message. + * @return the next definition stage. + */ + Update withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBQueue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBQueue refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueueListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueueListResult.java new file mode 100644 index 0000000000000..538730ab2d2e3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueueListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Queues operation. */ +@Fluent +public final class SBQueueListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBQueueListResult.class); + + /* + * Result of the List Queues operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of queues. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Queues operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Queues operation. + * + * @param value the value value to set. + * @return the SBQueueListResult object itself. + */ + public SBQueueListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * queues. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * queues. + * + * @param nextLink the nextLink value to set. + * @return the SBQueueListResult object itself. + */ + public SBQueueListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSku.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSku.java new file mode 100644 index 0000000000000..9c99a3adff2bc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSku.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of the namespace. */ +@Fluent +public final class SBSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBSku.class); + + /* + * Name of this SKU. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The billing tier of this particular SKU. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /* + * The specified messaging units for the tier. For Premium tier, capacity + * are 1,2 and 4. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: Name of this SKU. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Name of this SKU. + * + * @param name the name value to set. + * @return the SBSku object itself. + */ + public SBSku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The billing tier of this particular SKU. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The billing tier of this particular SKU. + * + * @param tier the tier value to set. + * @return the SBSku object itself. + */ + public SBSku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + * + * @param capacity the capacity value to set. + * @return the SBSku object itself. + */ + public SBSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model SBSku")); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscription.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscription.java new file mode 100644 index 0000000000000..6437904ca5084 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscription.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SBSubscription. */ +public interface SBSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the messageCount property: Number of messages. + * + * @return the messageCount value. + */ + Long messageCount(); + + /** + * Gets the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the accessedAt property: Last time there was a receive request to this subscription. + * + * @return the accessedAt value. + */ + OffsetDateTime accessedAt(); + + /** + * Gets the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the countDetails property: Message count details. + * + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * Gets the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @return the lockDuration value. + */ + Duration lockDuration(); + + /** + * Gets the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @return the requiresSession value. + */ + Boolean requiresSession(); + + /** + * Gets the defaultMessageTimeToLive property: 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. + */ + Duration defaultMessageTimeToLive(); + + /** + * Gets the deadLetteringOnFilterEvaluationExceptions property: Value that indicates whether a subscription has dead + * letter support on filter evaluation exceptions. + * + * @return the deadLetteringOnFilterEvaluationExceptions value. + */ + Boolean deadLetteringOnFilterEvaluationExceptions(); + + /** + * Gets the deadLetteringOnMessageExpiration property: Value that indicates whether a subscription has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + Boolean deadLetteringOnMessageExpiration(); + + /** + * Gets the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Duration duplicateDetectionHistoryTimeWindow(); + + /** + * Gets the maxDeliveryCount property: Number of maximum deliveries. + * + * @return the maxDeliveryCount value. + */ + Integer maxDeliveryCount(); + + /** + * Gets the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * Gets the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + Duration autoDeleteOnIdle(); + + /** + * Gets the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + String forwardTo(); + + /** + * Gets the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + String forwardDeadLetteredMessagesTo(); + + /** + * Gets the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @return the isClientAffine value. + */ + Boolean isClientAffine(); + + /** + * Gets the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @return the clientAffineProperties value. + */ + SBClientAffineProperties clientAffineProperties(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner object. + * + * @return the inner object. + */ + SBSubscriptionInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscriptionListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscriptionListResult.java new file mode 100644 index 0000000000000..d2efd5ad5740f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscriptionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Subscriptions operation. */ +@Fluent +public final class SBSubscriptionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBSubscriptionListResult.class); + + /* + * Result of the List Subscriptions operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of subscriptions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Subscriptions operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Subscriptions operation. + * + * @param value the value value to set. + * @return the SBSubscriptionListResult object itself. + */ + public SBSubscriptionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * subscriptions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * subscriptions. + * + * @param nextLink the nextLink value to set. + * @return the SBSubscriptionListResult object itself. + */ + public SBSubscriptionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopic.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopic.java new file mode 100644 index 0000000000000..f7db535ec2b6e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopic.java @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SBTopic. */ +public interface SBTopic { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the sizeInBytes property: Size of the topic, in bytes. + * + * @return the sizeInBytes value. + */ + Long sizeInBytes(); + + /** + * Gets the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the accessedAt property: Last time the message was sent, or a request was received, for this topic. + * + * @return the accessedAt value. + */ + OffsetDateTime accessedAt(); + + /** + * Gets the subscriptionCount property: Number of subscriptions. + * + * @return the subscriptionCount value. + */ + Integer subscriptionCount(); + + /** + * Gets the countDetails property: Message count details. + * + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * Gets the defaultMessageTimeToLive property: 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. + */ + Duration defaultMessageTimeToLive(); + + /** + * Gets the maxSizeInMegabytes property: 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. + */ + Integer maxSizeInMegabytes(); + + /** + * Gets the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + Long maxMessageSizeInKilobytes(); + + /** + * Gets the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + Boolean requiresDuplicateDetection(); + + /** + * Gets the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Duration duplicateDetectionHistoryTimeWindow(); + + /** + * Gets the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * Gets the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @return the supportOrdering value. + */ + Boolean supportOrdering(); + + /** + * Gets the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + Duration autoDeleteOnIdle(); + + /** + * Gets the enablePartitioning property: Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * + * @return the enablePartitioning value. + */ + Boolean enablePartitioning(); + + /** + * Gets the enableExpress property: 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. + */ + Boolean enableExpress(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner object. + * + * @return the inner object. + */ + SBTopicInner innerModel(); + + /** The entirety of the SBTopic definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SBTopic definition stages. */ + interface DefinitionStages { + /** The first stage of the SBTopic definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SBTopic definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDefaultMessageTimeToLive, + DefinitionStages.WithMaxSizeInMegabytes, + DefinitionStages.WithMaxMessageSizeInKilobytes, + DefinitionStages.WithRequiresDuplicateDetection, + DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, + DefinitionStages.WithEnableBatchedOperations, + DefinitionStages.WithStatus, + DefinitionStages.WithSupportOrdering, + DefinitionStages.WithAutoDeleteOnIdle, + DefinitionStages.WithEnablePartitioning, + DefinitionStages.WithEnableExpress { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBTopic create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBTopic create(Context context); + } + /** The stage of the SBTopic definition allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: 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 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(Duration defaultMessageTimeToLive); + } + /** The stage of the SBTopic definition allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of + * the memory allocated for the topic. Default is 1024.. + * + * @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 maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the topic. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * topic. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + WithCreate withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBTopic definition allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: Value indicating if this topic requires duplicate + * detection.. + * + * @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 duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @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(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBTopic definition allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @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 status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + WithCreate withStatus(EntityStatus status); + } + /** The stage of the SBTopic definition allowing to specify supportOrdering. */ + interface WithSupportOrdering { + /** + * Specifies the supportOrdering property: Value that indicates whether the topic supports ordering.. + * + * @param supportOrdering Value that indicates whether the topic supports ordering. + * @return the next definition stage. + */ + WithCreate withSupportOrdering(Boolean supportOrdering); + } + /** The stage of the SBTopic definition allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @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(Duration autoDeleteOnIdle); + } + /** The stage of the SBTopic definition allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: Value that indicates whether the topic to be partitioned + * across multiple message brokers is enabled.. + * + * @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 enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: 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 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); + } + } + /** + * Begins update for the SBTopic resource. + * + * @return the stage of resource update. + */ + SBTopic.Update update(); + + /** The template for SBTopic update. */ + interface Update + extends UpdateStages.WithDefaultMessageTimeToLive, + UpdateStages.WithMaxSizeInMegabytes, + UpdateStages.WithMaxMessageSizeInKilobytes, + UpdateStages.WithRequiresDuplicateDetection, + UpdateStages.WithDuplicateDetectionHistoryTimeWindow, + UpdateStages.WithEnableBatchedOperations, + UpdateStages.WithStatus, + UpdateStages.WithSupportOrdering, + UpdateStages.WithAutoDeleteOnIdle, + UpdateStages.WithEnablePartitioning, + UpdateStages.WithEnableExpress { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBTopic apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBTopic apply(Context context); + } + /** The SBTopic update stages. */ + interface UpdateStages { + /** The stage of the SBTopic update allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: 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 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. + */ + Update withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive); + } + /** The stage of the SBTopic update allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of + * the memory allocated for the topic. Default is 1024.. + * + * @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. + */ + Update withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + /** The stage of the SBTopic update allowing to specify maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the topic. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * topic. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + Update withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBTopic update allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: Value indicating if this topic requires duplicate + * detection.. + * + * @param requiresDuplicateDetection Value indicating if this topic requires duplicate detection. + * @return the next definition stage. + */ + Update withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + /** The stage of the SBTopic update allowing to specify duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @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. + */ + Update withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBTopic update allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled. + * @return the next definition stage. + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + /** The stage of the SBTopic update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + Update withStatus(EntityStatus status); + } + /** The stage of the SBTopic update allowing to specify supportOrdering. */ + interface WithSupportOrdering { + /** + * Specifies the supportOrdering property: Value that indicates whether the topic supports ordering.. + * + * @param supportOrdering Value that indicates whether the topic supports ordering. + * @return the next definition stage. + */ + Update withSupportOrdering(Boolean supportOrdering); + } + /** The stage of the SBTopic update allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @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. + */ + Update withAutoDeleteOnIdle(Duration autoDeleteOnIdle); + } + /** The stage of the SBTopic update allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: Value that indicates whether the topic to be partitioned + * across multiple message brokers is enabled.. + * + * @param enablePartitioning Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * @return the next definition stage. + */ + Update withEnablePartitioning(Boolean enablePartitioning); + } + /** The stage of the SBTopic update allowing to specify enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: 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 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. + */ + Update withEnableExpress(Boolean enableExpress); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBTopic refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBTopic refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopicListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopicListResult.java new file mode 100644 index 0000000000000..349545efd2cc2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopicListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Topics operation. */ +@Fluent +public final class SBTopicListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SBTopicListResult.class); + + /* + * Result of the List Topics operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of topics. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Topics operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Topics operation. + * + * @param value the value value to set. + * @return the SBTopicListResult object itself. + */ + public SBTopicListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * topics. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * topics. + * + * @param nextLink the nextLink value to set. + * @return the SBTopicListResult object itself. + */ + public SBTopicListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuName.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuName.java new file mode 100644 index 0000000000000..fb51ae63e45b2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuName.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SkuName. */ +public enum SkuName { + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuName instance. */ + private final String value; + + SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuTier.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuTier.java new file mode 100644 index 0000000000000..80c9458966a07 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuTier.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SkuTier. */ +public enum SkuTier { + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlFilter.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlFilter.java new file mode 100644 index 0000000000000..c850e8176d4c1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlFilter.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@Fluent +public final class SqlFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlFilter.class); + + /* + * 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 sqlExpression property: The SQL expression. e.g. MyProperty='ABC'. + * + * @return the sqlExpression value. + */ + public String sqlExpression() { + return this.sqlExpression; + } + + /** + * Set the sqlExpression property: 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 the compatibilityLevel property: 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 the compatibilityLevel property: 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 the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value. + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set the requiresPreprocessing property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlRuleAction.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlRuleAction.java new file mode 100644 index 0000000000000..031da0c1bdab6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlRuleAction.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** + * Represents set of actions written in SQL language-based syntax that is performed against a + * ServiceBus.Messaging.BrokeredMessage. + */ +@Fluent +public final class SqlRuleAction extends Action { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlRuleAction.class); + + /** {@inheritDoc} */ + @Override + public SqlRuleAction withSqlExpression(String sqlExpression) { + super.withSqlExpression(sqlExpression); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlRuleAction withCompatibilityLevel(Integer compatibilityLevel) { + super.withCompatibilityLevel(compatibilityLevel); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlRuleAction withRequiresPreprocessing(Boolean requiresPreprocessing) { + super.withRequiresPreprocessing(requiresPreprocessing); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subnet.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subnet.java new file mode 100644 index 0000000000000..6c51fac89e68d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subnet.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties supplied for Subnet. */ +@Fluent +public final class Subnet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Subnet.class); + + /* + * Resource ID of Virtual Network Subnet + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Resource ID of Virtual Network Subnet. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of Virtual Network Subnet. + * + * @param id the id value to set. + * @return the Subnet object itself. + */ + public Subnet withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property id in model Subnet")); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subscriptions.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subscriptions.java new file mode 100644 index 0000000000000..fc150a16ecdd5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subscriptions.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; + +/** Resource collection API of Subscriptions. */ +public interface Subscriptions { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + PagedIterable listByTopic(String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation. + */ + PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + SBSubscription createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + SBSubscription get(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Topics.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Topics.java new file mode 100644 index 0000000000000..1fac32ac5d5ce --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Topics.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; + +/** Resource collection API of Topics. */ +public interface Topics { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * 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 parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * 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 parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + AccessKeys listKeys(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace. + */ + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + SBTopic get(String resourceGroupName, String namespaceName, String topicName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * Returns a description for the specified topic. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + SBTopic getById(String id); + + /** + * Returns a description for the specified topic. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SBTopic resource. + * + * @param name resource name. + * @return the first stage of the new SBTopic definition. + */ + SBTopic.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UnavailableReason.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UnavailableReason.java new file mode 100644 index 0000000000000..1b181d9f5f07f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UnavailableReason.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +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 final 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/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentity.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..857710f907878 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recognized Dictionary value. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * Principal Id of user assigned identity + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * Client Id of user assigned identity + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: Principal Id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: Client Id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentityProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentityProperties.java new file mode 100644 index 0000000000000..c01e57208419f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentityProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserAssignedIdentityProperties model. */ +@Fluent +public final class UserAssignedIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentityProperties.class); + + /* + * ARM ID of user Identity selected for encryption + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /** + * Get the userAssignedIdentity property: ARM ID of user Identity selected for encryption. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: ARM ID of user Identity selected for encryption. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the UserAssignedIdentityProperties object itself. + */ + public UserAssignedIdentityProperties withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/package-info.java new file mode 100644 index 0000000000000..a9cf3b90b88fd --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for ServiceBusManagementClient. Azure Service Bus client for managing Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.models; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/package-info.java new file mode 100644 index 0000000000000..1da8dcb30ba04 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ServiceBusManagementClient. Azure Service Bus client for managing Namespace. */ +package com.azure.resourcemanager.servicebus.generated; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/module-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..5d613af98fdb4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.servicebus.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.servicebus.generated; + exports com.azure.resourcemanager.servicebus.generated.fluent; + exports com.azure.resourcemanager.servicebus.generated.fluent.models; + exports com.azure.resourcemanager.servicebus.generated.models; + + opens com.azure.resourcemanager.servicebus.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.servicebus.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/servicebus/ci.yml b/sdk/servicebus/ci.yml index ebfadd6e30afd..d5d0fc1763120 100644 --- a/sdk/servicebus/ci.yml +++ b/sdk/servicebus/ci.yml @@ -47,6 +47,9 @@ extends: - name: azure-messaging-servicebus groupId: com.azure safeName: azuremessagingservicebus + - name: azure-resourcemanager-servicebus-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerservicebusgenerated AdditionalModules: - name: perf-test-core groupId: com.azure diff --git a/sdk/servicebus/pom.xml b/sdk/servicebus/pom.xml index 57a9efab14627..b8f177ecc56fc 100644 --- a/sdk/servicebus/pom.xml +++ b/sdk/servicebus/pom.xml @@ -50,10 +50,11 @@ true - microsoft-azure-servicebus azure-messaging-servicebus azure-messaging-servicebus-track1-perf azure-messaging-servicebus-track2-perf + azure-resourcemanager-servicebus-generated + microsoft-azure-servicebus