diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 04d455d0882fb..f52b060125d3a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -313,6 +313,7 @@ com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-eventhubs-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/eventhubs/azure-resourcemanager-eventhubs-generated/CHANGELOG.md b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/CHANGELOG.md new file mode 100644 index 0000000000000..e74b669dd63c6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-08-24) + +- Azure Resource Manager EventHubs client library for Java. This package contains Microsoft Azure SDK for EventHubs Management SDK. Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. Package tag package-2018-01-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/eventhubs/azure-resourcemanager-eventhubs-generated/README.md b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/README.md new file mode 100644 index 0000000000000..2b193aca2a38e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager EventHubs client library for Java + +Azure Resource Manager EventHubs client library for Java. + +This package contains Microsoft Azure SDK for EventHubs Management SDK. Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. Package tag package-2018-01-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-eventhubs-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-eventhubs-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(); +EventHubsManager manager = EventHubsManager + .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/eventhubs/azure-resourcemanager-eventhubs-generated/pom.xml b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/pom.xml new file mode 100644 index 0000000000000..da2f09ec68fd1 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-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-eventhubs-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for EventHubs Management + This package contains Microsoft Azure SDK for EventHubs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. Package tag package-2018-01-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.19.0 + + + com.azure + azure-core-management + 1.4.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/EventHubsManager.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/EventHubsManager.java new file mode 100644 index 0000000000000..03d5f6279b3db --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/EventHubsManager.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.EventHubManagementClient; +import com.azure.resourcemanager.eventhubs.generated.implementation.ClustersImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.ConfigurationsImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.ConsumerGroupsImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.DisasterRecoveryConfigsImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.EventHubManagementClientBuilder; +import com.azure.resourcemanager.eventhubs.generated.implementation.EventHubsImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.NamespacesImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.eventhubs.generated.implementation.RegionsImpl; +import com.azure.resourcemanager.eventhubs.generated.models.Clusters; +import com.azure.resourcemanager.eventhubs.generated.models.Configurations; +import com.azure.resourcemanager.eventhubs.generated.models.ConsumerGroups; +import com.azure.resourcemanager.eventhubs.generated.models.DisasterRecoveryConfigs; +import com.azure.resourcemanager.eventhubs.generated.models.EventHubs; +import com.azure.resourcemanager.eventhubs.generated.models.Namespaces; +import com.azure.resourcemanager.eventhubs.generated.models.Operations; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.eventhubs.generated.models.Regions; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Entry point to EventHubsManager. Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and + * VirtualNetworkRules resources. + */ +public final class EventHubsManager { + private Clusters clusters; + + private Namespaces namespaces; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private Configurations configurations; + + private DisasterRecoveryConfigs disasterRecoveryConfigs; + + private EventHubs eventHubs; + + private ConsumerGroups consumerGroups; + + private Operations operations; + + private Regions regions; + + private final EventHubManagementClient clientObject; + + private EventHubsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new EventHubManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of EventHubs service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the EventHubs service API instance. + */ + public static EventHubsManager 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 EventHubsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new EventHubsManager.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 EventHubs service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the EventHubs service API instance. + */ + public EventHubsManager 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.eventhubs.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 EventHubsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Clusters. */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** @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 Configurations. */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); + } + return configurations; + } + + /** @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 EventHubs. */ + public EventHubs eventHubs() { + if (this.eventHubs == null) { + this.eventHubs = new EventHubsImpl(clientObject.getEventHubs(), this); + } + return eventHubs; + } + + /** @return Resource collection API of ConsumerGroups. */ + public ConsumerGroups consumerGroups() { + if (this.consumerGroups == null) { + this.consumerGroups = new ConsumerGroupsImpl(clientObject.getConsumerGroups(), this); + } + return consumerGroups; + } + + /** @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 Regions. */ + public Regions regions() { + if (this.regions == null) { + this.regions = new RegionsImpl(clientObject.getRegions(), this); + } + return regions; + } + + /** + * @return Wrapped service client EventHubManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public EventHubManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ClustersClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ClustersClient.java new file mode 100644 index 0000000000000..b17e603aca213 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ClustersClient.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.AvailableClustersListInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceIdListResultInner; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public interface ClustersClient { + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @throws com.azure.core.management.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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableClustersListInner listAvailableClusterRegion(); + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableClusterRegionWithResponse(Context context); + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context); + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Namespace IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EHNamespaceIdListResultInner listNamespaces(String resourceGroupName, String clusterName); + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 Namespace IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listNamespacesWithResponse( + String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ConfigurationsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ConfigurationsClient.java new file mode 100644 index 0000000000000..12fc735b201b6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ConfigurationsClient.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.eventhubs.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.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; + +/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ +public interface ConfigurationsClient { + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterQuotaConfigurationPropertiesInner patch( + String resourceGroupName, String clusterName, ClusterQuotaConfigurationPropertiesInner parameters); + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String resourceGroupName, + String clusterName, + ClusterQuotaConfigurationPropertiesInner parameters, + Context context); + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterQuotaConfigurationPropertiesInner get(String resourceGroupName, String clusterName); + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ConsumerGroupsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ConsumerGroupsClient.java new file mode 100644 index 0000000000000..a88324268cdbf --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ConsumerGroupsClient.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.ConsumerGroupInner; + +/** An instance of this class provides access to all the operations defined in ConsumerGroupsClient. */ +public interface ConsumerGroupsClient { + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsumerGroupInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner parameters); + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner parameters, + Context context); + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName); + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName, Context context); + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsumerGroupInner get( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, Context context); + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEventHub( + String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEventHub( + String resourceGroupName, + String namespaceName, + String eventHubName, + Integer skip, + Integer top, + Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/DisasterRecoveryConfigsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/DisasterRecoveryConfigsClient.java new file mode 100644 index 0000000000000..9db0b8afaa221 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/DisasterRecoveryConfigsClient.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; + +/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ +public interface DisasterRecoveryConfigsClient { + /** + * Gets a list of 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 a list of authorization rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias); + + /** + * Gets a list of 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 a list of authorization rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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); + + /** + * 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 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, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/EventHubManagementClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/EventHubManagementClient.java new file mode 100644 index 0000000000000..a6a4f92986070 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/EventHubManagementClient.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.eventhubs.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for EventHubManagementClient class. */ +public interface EventHubManagementClient { + /** + * 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 ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * 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 ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + ConfigurationsClient getConfigurations(); + + /** + * Gets the DisasterRecoveryConfigsClient object to access its operations. + * + * @return the DisasterRecoveryConfigsClient object. + */ + DisasterRecoveryConfigsClient getDisasterRecoveryConfigs(); + + /** + * Gets the EventHubsClient object to access its operations. + * + * @return the EventHubsClient object. + */ + EventHubsClient getEventHubs(); + + /** + * Gets the ConsumerGroupsClient object to access its operations. + * + * @return the ConsumerGroupsClient object. + */ + ConsumerGroupsClient getConsumerGroups(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the RegionsClient object to access its operations. + * + * @return the RegionsClient object. + */ + RegionsClient getRegions(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/EventHubsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/EventHubsClient.java new file mode 100644 index 0000000000000..490d45ae15ad5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/EventHubsClient.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; + +/** An instance of this class provides access to all the operations defined in EventHubsClient. */ +public interface EventHubsClient { + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName, Context context); + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters); + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context); + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context); + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, String authorizationRuleName); + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, + String authorizationRuleName, + Context context); + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context); + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Gets all the Event Hubs 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 Event Hubs in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets all the Event Hubs 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 Event Hubs in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventhubInner createOrUpdate( + String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters); + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters, Context context); + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName); + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, Context context); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/NamespacesClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/NamespacesClient.java new file mode 100644 index 0000000000000..ecef67f139649 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/NamespacesClient.java @@ -0,0 +1,783 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; + +/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +public interface NamespacesClient { + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listIpFilterRules(String resourceGroupName, String namespaceName); + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listIpFilterRules(String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpFilterRuleInner createOrUpdateIpFilterRule( + String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters); + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @param 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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateIpFilterRuleWithResponse( + String resourceGroupName, + String namespaceName, + String ipFilterRuleName, + IpFilterRuleInner parameters, + Context context); + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName); + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 deleteIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context); + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpFilterRuleInner getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName); + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context); + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists 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 response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists 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 response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EHNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters); + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EHNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context); + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EHNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters); + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EHNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner 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 the description of 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 the description of the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Gets the description of 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 the description of the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters); + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context); + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualNetworkRules(String resourceGroupName, String namespaceName); + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualNetworkRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner parameters); + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateVirtualNetworkRuleWithResponse( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner parameters, + Context context); + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName); + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param 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 deleteVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, Context context); + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkRuleInner getVirtualNetworkRule( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName); + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, 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 topic 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 topic 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 a list of 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 a list of authorization rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + + /** + * Gets a list of 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 a list of authorization rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates an AuthorizationRule 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 AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner parameters); + + /** + * Creates or updates an AuthorizationRule 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 AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context); + + /** + * Deletes an AuthorizationRule 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an AuthorizationRule 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 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 AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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 specified 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 required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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/EventHub 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 specified 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 required to regenerate the connection string. + * @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/EventHub 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabilityParameter 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityParameter parameters, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/OperationsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..34a714113a5e2 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.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 Event Hub 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 Event Hub operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Event Hub 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 Event Hub operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..e35f456f64ffd --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.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 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 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 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 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 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 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 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 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 name. + * + * @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 name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @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 name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/PrivateLinkResourcesClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..863f73d3ec998 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/RegionsClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/RegionsClient.java new file mode 100644 index 0000000000000..3f9bab2970057 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/RegionsClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.MessagingRegionsInner; + +/** An instance of this class provides access to all the operations defined in RegionsClient. */ +public interface RegionsClient { + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySku(String sku); + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySku(String sku, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AccessKeysInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AccessKeysInner.java new file mode 100644 index 0000000000000..0da4b05769a74 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/EventHub Connection String. */ +@Immutable +public final class AccessKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessKeysInner.class); + + /* + * Primary connection string of the created namespace AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String primaryConnectionString; + + /* + * Secondary connection string of the created namespace AuthorizationRule. + */ + @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 AuthorizationRule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * Get the primaryConnectionString property: Primary connection string of the created namespace AuthorizationRule. + * + * @return the primaryConnectionString value. + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Get the secondaryConnectionString property: Secondary connection string of the created namespace + * AuthorizationRule. + * + * @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 AuthorizationRule. + * + * @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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryInner.java new file mode 100644 index 0000000000000..31b26936639b2 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.eventhubs.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); + + /* + * 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; + + /* + * ARM Id of the Primary/Secondary eventhub namespace name, which is part + * of GEO DR pairing + */ + @JsonProperty(value = "properties.partnerNamespace") + private String partnerNamespace; + + /* + * Alternate name specified when alias and namespace names are same. + */ + @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; + + /* + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "properties.pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long pendingReplicationOperationsCount; + + /** + * 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 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: Alternate name specified when alias and namespace names are same. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set the alternateName property: Alternate name specified when alias and namespace names are same. + * + * @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; + } + + /** + * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleInner.java new file mode 100644 index 0000000000000..b3b717362be92 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.AccessRights; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Single item in a List or Get AuthorizationRule operation. */ +@JsonFlatten +@Fluent +public class AuthorizationRuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleInner.class); + + /* + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights") + private List rights; + + /** + * 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 AuthorizationRuleInner object itself. + */ + public AuthorizationRuleInner 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AvailableClustersListInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AvailableClustersListInner.java new file mode 100644 index 0000000000000..55fa560b20815 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AvailableClustersListInner.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.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.AvailableCluster; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List Available Clusters operation. */ +@Fluent +public final class AvailableClustersListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableClustersListInner.class); + + /* + * The count of readily available and pre-provisioned Event Hubs Clusters + * per region. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The count of readily available and pre-provisioned Event Hubs Clusters per region. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The count of readily available and pre-provisioned Event Hubs Clusters per region. + * + * @param value the value value to set. + * @return the AvailableClustersListInner object itself. + */ + public AvailableClustersListInner withValue(List value) { + this.value = value; + 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..0d50aa6a3bff6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.UnavailableReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Result of the CheckNameAvailability operation. */ +@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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterInner.java new file mode 100644 index 0000000000000..b4c6e2c44162d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Single Event Hubs Cluster resource in List or Get operations. */ +@JsonFlatten +@Fluent +public class ClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); + + /* + * Properties of the cluster SKU. + */ + @JsonProperty(value = "sku") + private ClusterSku sku; + + /* + * The UTC time when the Event Hubs Cluster was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * The UTC time when the Event Hubs Cluster was last updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private String updatedAt; + + /* + * The metric ID of the cluster resource. Provided by the service and not + * modifiable by the user. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Status of the Cluster resource + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Get the sku property: Properties of the cluster SKU. + * + * @return the sku value. + */ + public ClusterSku sku() { + return this.sku; + } + + /** + * Set the sku property: Properties of the cluster SKU. + * + * @param sku the sku value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSku(ClusterSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the createdAt property: The UTC time when the Event Hubs Cluster was created. + * + * @return the createdAt value. + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The UTC time when the Event Hubs Cluster was last updated. + * + * @return the updatedAt value. + */ + public String updatedAt() { + return this.updatedAt; + } + + /** + * Get the metricId property: The metric ID of the cluster resource. Provided by the service and not modifiable by + * the user. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the status property: Status of the Cluster resource. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner 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(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterQuotaConfigurationPropertiesInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterQuotaConfigurationPropertiesInner.java new file mode 100644 index 0000000000000..af3ca765e348f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterQuotaConfigurationPropertiesInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.fluent.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; + +/** Contains all settings for the cluster. */ +@Fluent +public final class ClusterQuotaConfigurationPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterQuotaConfigurationPropertiesInner.class); + + /* + * All possible Cluster settings - a collection of key/value paired + * settings which apply to quotas and configurations imposed on the + * cluster. + */ + @JsonProperty(value = "settings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; + + /** + * Get the settings property: All possible Cluster settings - a collection of key/value paired settings which apply + * to quotas and configurations imposed on the cluster. + * + * @return the settings value. + */ + public Map settings() { + return this.settings; + } + + /** + * Set the settings property: All possible Cluster settings - a collection of key/value paired settings which apply + * to quotas and configurations imposed on the cluster. + * + * @param settings the settings value to set. + * @return the ClusterQuotaConfigurationPropertiesInner object itself. + */ + public ClusterQuotaConfigurationPropertiesInner withSettings(Map settings) { + this.settings = settings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupInner.java new file mode 100644 index 0000000000000..5c1cee08befa6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupInner.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Single item in List or Get Consumer group operation. */ +@JsonFlatten +@Fluent +public class ConsumerGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupInner.class); + + /* + * 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; + + /* + * User Metadata is a placeholder to store user-defined string data with + * maximum length 1024. e.g. it can be used to store descriptive data, such + * as list of teams and their contact information also user-defined + * configuration settings can be stored. + */ + @JsonProperty(value = "properties.userMetadata") + private String userMetadata; + + /** + * 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 userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum + * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information + * also user-defined configuration settings can be stored. + * + * @return the userMetadata value. + */ + public String userMetadata() { + return this.userMetadata; + } + + /** + * Set the userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum + * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information + * also user-defined configuration settings can be stored. + * + * @param userMetadata the userMetadata value to set. + * @return the ConsumerGroupInner object itself. + */ + public ConsumerGroupInner withUserMetadata(String userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceIdListResultInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceIdListResultInner.java new file mode 100644 index 0000000000000..8eb7e4a0a96fd --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceIdListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespaceIdContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List Namespace IDs operation. */ +@Fluent +public final class EHNamespaceIdListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceIdListResultInner.class); + + /* + * Result of the List Namespace IDs operation + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Result of the List Namespace IDs operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Namespace IDs operation. + * + * @param value the value value to set. + * @return the EHNamespaceIdListResultInner object itself. + */ + public EHNamespaceIdListResultInner withValue(List value) { + this.value = value; + 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceInner.java new file mode 100644 index 0000000000000..f74922777399c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceInner.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.Encryption; +import com.azure.resourcemanager.eventhubs.generated.models.Identity; +import com.azure.resourcemanager.eventhubs.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Single Namespace item in List or Get Operation. */ +@JsonFlatten +@Fluent +public class EHNamespaceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceInner.class); + + /* + * Properties of sku resource + */ + @JsonProperty(value = "sku") + private Sku 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; + + /* + * Cluster ARM ID of the Namespace. + */ + @JsonProperty(value = "properties.clusterArmId") + private String clusterArmId; + + /* + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Value that indicates whether AutoInflate is enabled for eventhub + * namespace. + */ + @JsonProperty(value = "properties.isAutoInflateEnabled") + private Boolean isAutoInflateEnabled; + + /* + * Upper limit of throughput units when AutoInflate is enabled, value + * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = + * true) + */ + @JsonProperty(value = "properties.maximumThroughputUnits") + private Integer maximumThroughputUnits; + + /* + * Value that indicates whether Kafka is enabled for eventhub namespace. + */ + @JsonProperty(value = "properties.kafkaEnabled") + private Boolean kafkaEnabled; + + /* + * Enabling this property creates a Standard Event Hubs 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; + + /** + * Get the sku property: Properties of sku resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Properties of sku resource. + * + * @param sku the sku value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withSku(Sku 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 EHNamespaceInner object itself. + */ + public EHNamespaceInner 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 clusterArmId property: Cluster ARM ID of the Namespace. + * + * @return the clusterArmId value. + */ + public String clusterArmId() { + return this.clusterArmId; + } + + /** + * Set the clusterArmId property: Cluster ARM ID of the Namespace. + * + * @param clusterArmId the clusterArmId value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withClusterArmId(String clusterArmId) { + this.clusterArmId = clusterArmId; + return this; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub + * namespace. + * + * @return the isAutoInflateEnabled value. + */ + public Boolean isAutoInflateEnabled() { + return this.isAutoInflateEnabled; + } + + /** + * Set the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub + * namespace. + * + * @param isAutoInflateEnabled the isAutoInflateEnabled value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { + this.isAutoInflateEnabled = isAutoInflateEnabled; + return this; + } + + /** + * Get the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value + * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * + * @return the maximumThroughputUnits value. + */ + public Integer maximumThroughputUnits() { + return this.maximumThroughputUnits; + } + + /** + * Set the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value + * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * + * @param maximumThroughputUnits the maximumThroughputUnits value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withMaximumThroughputUnits(Integer maximumThroughputUnits) { + this.maximumThroughputUnits = maximumThroughputUnits; + return this; + } + + /** + * Get the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. + * + * @return the kafkaEnabled value. + */ + public Boolean kafkaEnabled() { + return this.kafkaEnabled; + } + + /** + * Set the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. + * + * @param kafkaEnabled the kafkaEnabled value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withKafkaEnabled(Boolean kafkaEnabled) { + this.kafkaEnabled = kafkaEnabled; + return this; + } + + /** + * Get the zoneRedundant property: Enabling this property creates a Standard Event Hubs 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 Standard Event Hubs Namespace in regions + * supported availability zones. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner 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 EHNamespaceInner object itself. + */ + public EHNamespaceInner withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** {@inheritDoc} */ + @Override + public EHNamespaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public EHNamespaceInner 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(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubInner.java new file mode 100644 index 0000000000000..46882829e4bd6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubInner.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.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.CaptureDescription; +import com.azure.resourcemanager.eventhubs.generated.models.EntityStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Single item in List or Get Event Hub operation. */ +@JsonFlatten +@Fluent +public class EventhubInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventhubInner.class); + + /* + * Current number of shards on the Event Hub. + */ + @JsonProperty(value = "properties.partitionIds", access = JsonProperty.Access.WRITE_ONLY) + private List partitionIds; + + /* + * Exact time the Event Hub was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Number of days to retain the events for this Event Hub, value should be + * 1 to 7 days + */ + @JsonProperty(value = "properties.messageRetentionInDays") + private Long messageRetentionInDays; + + /* + * Number of partitions created for the Event Hub, allowed values are from + * 1 to 32 partitions. + */ + @JsonProperty(value = "properties.partitionCount") + private Long partitionCount; + + /* + * Enumerates the possible values for the status of the Event Hub. + */ + @JsonProperty(value = "properties.status") + private EntityStatus status; + + /* + * Properties of capture description + */ + @JsonProperty(value = "properties.captureDescription") + private CaptureDescription captureDescription; + + /** + * Get the partitionIds property: Current number of shards on the Event Hub. + * + * @return the partitionIds value. + */ + public List partitionIds() { + return this.partitionIds; + } + + /** + * Get the createdAt property: Exact time the Event Hub 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 messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be + * 1 to 7 days. + * + * @return the messageRetentionInDays value. + */ + public Long messageRetentionInDays() { + return this.messageRetentionInDays; + } + + /** + * Set the messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be + * 1 to 7 days. + * + * @param messageRetentionInDays the messageRetentionInDays value to set. + * @return the EventhubInner object itself. + */ + public EventhubInner withMessageRetentionInDays(Long messageRetentionInDays) { + this.messageRetentionInDays = messageRetentionInDays; + return this; + } + + /** + * Get the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 + * partitions. + * + * @return the partitionCount value. + */ + public Long partitionCount() { + return this.partitionCount; + } + + /** + * Set the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 + * partitions. + * + * @param partitionCount the partitionCount value to set. + * @return the EventhubInner object itself. + */ + public EventhubInner withPartitionCount(Long partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of the Event Hub. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of the Event Hub. + * + * @param status the status value to set. + * @return the EventhubInner object itself. + */ + public EventhubInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the captureDescription property: Properties of capture description. + * + * @return the captureDescription value. + */ + public CaptureDescription captureDescription() { + return this.captureDescription; + } + + /** + * Set the captureDescription property: Properties of capture description. + * + * @param captureDescription the captureDescription value to set. + * @return the EventhubInner object itself. + */ + public EventhubInner withCaptureDescription(CaptureDescription captureDescription) { + this.captureDescription = captureDescription; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (captureDescription() != null) { + captureDescription().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/IpFilterRuleInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/IpFilterRuleInner.java new file mode 100644 index 0000000000000..6634ce58b45e7 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/IpFilterRuleInner.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.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.IpAction; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single item in a List or Get IpFilterRules operation. */ +@JsonFlatten +@Fluent +public class IpFilterRuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpFilterRuleInner.class); + + /* + * IP Mask + */ + @JsonProperty(value = "properties.ipMask") + private String ipMask; + + /* + * The IP Filter Action + */ + @JsonProperty(value = "properties.action") + private IpAction action; + + /* + * IP Filter name + */ + @JsonProperty(value = "properties.filterName") + private String filterName; + + /** + * 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 IpFilterRuleInner object itself. + */ + public IpFilterRuleInner withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get the action property: The IP Filter Action. + * + * @return the action value. + */ + public IpAction action() { + return this.action; + } + + /** + * Set the action property: The IP Filter Action. + * + * @param action the action value to set. + * @return the IpFilterRuleInner object itself. + */ + public IpFilterRuleInner withAction(IpAction action) { + this.action = action; + return this; + } + + /** + * Get the filterName property: IP Filter name. + * + * @return the filterName value. + */ + public String filterName() { + return this.filterName; + } + + /** + * Set the filterName property: IP Filter name. + * + * @param filterName the filterName value to set. + * @return the IpFilterRuleInner object itself. + */ + public IpFilterRuleInner withFilterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/MessagingRegionsInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/MessagingRegionsInner.java new file mode 100644 index 0000000000000..d30909c258634 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/MessagingRegionsInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.MessagingRegionsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Messaging Region. */ +@Fluent +public final class MessagingRegionsInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MessagingRegionsInner.class); + + /* + * Properties of Messaging Region + */ + @JsonProperty(value = "properties") + private MessagingRegionsProperties properties; + + /** + * Get the properties property: Properties of Messaging Region. + * + * @return the properties value. + */ + public MessagingRegionsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Messaging Region. + * + * @param properties the properties value to set. + * @return the MessagingRegionsInner object itself. + */ + public MessagingRegionsInner withProperties(MessagingRegionsProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public MessagingRegionsInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MessagingRegionsInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetInner.java new file mode 100644 index 0000000000000..6cf28c9edd468 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.DefaultAction; +import com.azure.resourcemanager.eventhubs.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.eventhubs.generated.models.NWRuleSetVirtualNetworkRules; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of topic resource. */ +@JsonFlatten +@Fluent +public class NetworkRuleSetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetInner.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/OperationInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..5743e7f557dca --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Event Hub 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..5f5807656de9f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.ConnectionState; +import com.azure.resourcemanager.eventhubs.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.eventhubs.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 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 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateLinkResourcesListResultInner.java new file mode 100644 index 0000000000000..862538ba8b37a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/VirtualNetworkRuleInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/VirtualNetworkRuleInner.java new file mode 100644 index 0000000000000..a6691fb2b1595 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/VirtualNetworkRuleInner.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.eventhubs.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single item in a List or Get VirtualNetworkRules operation. */ +@JsonFlatten +@Fluent +public class VirtualNetworkRuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRuleInner.class); + + /* + * ARM ID of Virtual Network Subnet + */ + @JsonProperty(value = "properties.virtualNetworkSubnetId") + private String virtualNetworkSubnetId; + + /** + * Get the virtualNetworkSubnetId property: ARM ID of Virtual Network Subnet. + * + * @return the virtualNetworkSubnetId value. + */ + public String virtualNetworkSubnetId() { + return this.virtualNetworkSubnetId; + } + + /** + * Set the virtualNetworkSubnetId property: ARM ID of Virtual Network Subnet. + * + * @param virtualNetworkSubnetId the virtualNetworkSubnetId value to set. + * @return the VirtualNetworkRuleInner object itself. + */ + public VirtualNetworkRuleInner withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.virtualNetworkSubnetId = virtualNetworkSubnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/package-info.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..51afc5de69759 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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 EventHubManagementClient. Azure Event Hubs client for managing Event + * Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. + */ +package com.azure.resourcemanager.eventhubs.generated.fluent.models; diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/package-info.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/package-info.java new file mode 100644 index 0000000000000..3c7d629f797ff --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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 EventHubManagementClient. Azure Event Hubs client for managing Event Hubs + * Cluster, IPFilter Rules and VirtualNetworkRules resources. + */ +package com.azure.resourcemanager.eventhubs.generated.fluent; diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AccessKeysImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AccessKeysImpl.java new file mode 100644 index 0000000000000..a87e58ed55897 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessKeys; + +public final class AccessKeysImpl implements AccessKeys { + private AccessKeysInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + AccessKeysImpl( + AccessKeysInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ArmDisasterRecoveryImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ArmDisasterRecoveryImpl.java new file mode 100644 index 0000000000000..5cfcc4cb2b67c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ArmDisasterRecoveryImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.eventhubs.generated.models.ArmDisasterRecovery; +import com.azure.resourcemanager.eventhubs.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.eventhubs.generated.models.RoleDisasterRecovery; + +public final class ArmDisasterRecoveryImpl + implements ArmDisasterRecovery, ArmDisasterRecovery.Definition, ArmDisasterRecovery.Update { + private ArmDisasterRecoveryInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningStateDR provisioningState() { + return this.innerModel().provisioningState(); + } + + public String partnerNamespace() { + return this.innerModel().partnerNamespace(); + } + + public String alternateName() { + return this.innerModel().alternateName(); + } + + public RoleDisasterRecovery role() { + return this.innerModel().role(); + } + + public Long pendingReplicationOperationsCount() { + return this.innerModel().pendingReplicationOperationsCount(); + } + + public ArmDisasterRecoveryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager 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(Context context) { + return serviceManager + .disasterRecoveryConfigs() + .failOverWithResponse(resourceGroupName, namespaceName, alias, 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AuthorizationRuleImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AuthorizationRuleImpl.java new file mode 100644 index 0000000000000..33ce8adfa3ac0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AuthorizationRuleImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessKeys; +import com.azure.resourcemanager.eventhubs.generated.models.AccessRights; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRule; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; +import java.util.Collections; +import java.util.List; + +public final class AuthorizationRuleImpl + implements AuthorizationRule, AuthorizationRule.Definition, AuthorizationRule.Update { + private AuthorizationRuleInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List rights() { + List inner = this.innerModel().rights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AuthorizationRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String authorizationRuleName; + + public AuthorizationRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public AuthorizationRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AuthorizationRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + AuthorizationRuleImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new AuthorizationRuleInner(); + this.serviceManager = serviceManager; + this.authorizationRuleName = name; + } + + public AuthorizationRuleImpl update() { + return this; + } + + public AuthorizationRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AuthorizationRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + AuthorizationRuleImpl( + AuthorizationRuleInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 AuthorizationRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + return this; + } + + public AuthorizationRule 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 AuthorizationRuleImpl withRights(List rights) { + this.innerModel().withRights(rights); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AvailableClustersListImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AvailableClustersListImpl.java new file mode 100644 index 0000000000000..e744a06779188 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AvailableClustersListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AvailableClustersListInner; +import com.azure.resourcemanager.eventhubs.generated.models.AvailableCluster; +import com.azure.resourcemanager.eventhubs.generated.models.AvailableClustersList; +import java.util.Collections; +import java.util.List; + +public final class AvailableClustersListImpl implements AvailableClustersList { + private AvailableClustersListInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + AvailableClustersListImpl( + AvailableClustersListInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 AvailableClustersListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/CheckNameAvailabilityResultImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..dd1a076e0c7e0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.eventhubs.generated.models.UnavailableReason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..7c1f1951d1d89 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterImpl.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.eventhubs.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterInner; +import com.azure.resourcemanager.eventhubs.generated.models.Cluster; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterSku; +import java.util.Collections; +import java.util.Map; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 ClusterSku sku() { + return this.innerModel().sku(); + } + + public String createdAt() { + return this.innerModel().createdAt(); + } + + public String updatedAt() { + return this.innerModel().updatedAt(); + } + + public String metricId() { + return this.innerModel().metricId(); + } + + public String status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + public ClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl( + ClusterInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ClusterImpl withSku(ClusterSku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterQuotaConfigurationPropertiesImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterQuotaConfigurationPropertiesImpl.java new file mode 100644 index 0000000000000..7df982d939ee1 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterQuotaConfigurationPropertiesImpl.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.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterQuotaConfigurationProperties; +import java.util.Collections; +import java.util.Map; + +public final class ClusterQuotaConfigurationPropertiesImpl implements ClusterQuotaConfigurationProperties { + private ClusterQuotaConfigurationPropertiesInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + ClusterQuotaConfigurationPropertiesImpl( + ClusterQuotaConfigurationPropertiesInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map settings() { + Map inner = this.innerModel().settings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ClusterQuotaConfigurationPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersClientImpl.java new file mode 100644 index 0000000000000..71ff6b445efbe --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersClientImpl.java @@ -0,0 +1,1577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.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.eventhubs.generated.fluent.ClustersClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AvailableClustersListInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceIdListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterListResult; +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 ClustersClient. */ +public final class ClustersClientImpl implements ClustersClient { + private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final EventHubManagementClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(EventHubManagementClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface ClustersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableClusterRegion( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}/namespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNamespaces( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @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); + } + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @throws 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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableClusterRegionWithResponseAsync() { + 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 + .listAvailableClusterRegion( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableClusterRegionWithResponseAsync(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 + .listAvailableClusterRegion( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @throws 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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableClusterRegionAsync() { + return listAvailableClusterRegionWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @throws 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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableClustersListInner listAvailableClusterRegion() { + return listAvailableClusterRegionAsync().block(); + } + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @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 Available Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableClusterRegionWithResponse(Context context) { + return listAvailableClusterRegionWithResponseAsync(context).block(); + } + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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 the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 resource description of the specified Event Hubs Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Creates or updates an instance of an Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster 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 single Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters) { + return updateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @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 Event Hubs Cluster resource in List or Get operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNamespacesWithResponseAsync( + String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listNamespaces( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNamespacesWithResponseAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNamespaces( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listNamespacesAsync(String resourceGroupName, String clusterName) { + return listNamespacesWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EHNamespaceIdListResultInner listNamespaces(String resourceGroupName, String clusterName) { + return listNamespacesAsync(resourceGroupName, clusterName).block(); + } + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 IDs operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listNamespacesWithResponse( + String resourceGroupName, String clusterName, Context context) { + return listNamespacesWithResponseAsync(resourceGroupName, clusterName, 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 Event Hubs Clusters 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 Event Hubs Clusters 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)); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..65c312744cd90 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersImpl.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.eventhubs.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.eventhubs.generated.fluent.ClustersClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AvailableClustersListInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceIdListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.AvailableClustersList; +import com.azure.resourcemanager.eventhubs.generated.models.Cluster; +import com.azure.resourcemanager.eventhubs.generated.models.Clusters; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespaceIdListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClustersImpl implements Clusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public ClustersImpl( + ClustersClient innerClient, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AvailableClustersList listAvailableClusterRegion() { + AvailableClustersListInner inner = this.serviceClient().listAvailableClusterRegion(); + if (inner != null) { + return new AvailableClustersListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAvailableClusterRegionWithResponse(Context context) { + Response inner = + this.serviceClient().listAvailableClusterRegionWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AvailableClustersListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public EHNamespaceIdListResult listNamespaces(String resourceGroupName, String clusterName) { + EHNamespaceIdListResultInner inner = this.serviceClient().listNamespaces(resourceGroupName, clusterName); + if (inner != null) { + return new EHNamespaceIdListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listNamespacesWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().listNamespacesWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EHNamespaceIdListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Cluster 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsClientImpl.java new file mode 100644 index 0000000000000..b749af2427f0a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsClientImpl.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.eventhubs.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.eventhubs.generated.fluent.ConfigurationsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ +public final class ConfigurationsClientImpl implements ConfigurationsClient { + private final ClientLogger logger = new ClientLogger(ConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConfigurationsService service; + + /** The service client containing this operation class. */ + private final EventHubManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationsClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy.create(ConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface ConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}/quotaConfiguration/default") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterQuotaConfigurationPropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters" + + "/{clusterName}/quotaConfiguration/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, String clusterName, ClusterQuotaConfigurationPropertiesInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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 + .patch( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, + String clusterName, + ClusterQuotaConfigurationPropertiesInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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 + .patch( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, String clusterName, ClusterQuotaConfigurationPropertiesInner parameters) { + return patchWithResponseAsync(resourceGroupName, clusterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterQuotaConfigurationPropertiesInner patch( + String resourceGroupName, String clusterName, ClusterQuotaConfigurationPropertiesInner parameters) { + return patchAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse( + String resourceGroupName, + String clusterName, + ClusterQuotaConfigurationPropertiesInner parameters, + Context context) { + return patchWithResponseAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName) { + return getWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterQuotaConfigurationPropertiesInner get(String resourceGroupName, String clusterName) { + return getAsync(resourceGroupName, clusterName).block(); + } + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, context).block(); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..2b842256668f0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.ConfigurationsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterQuotaConfigurationProperties; +import com.azure.resourcemanager.eventhubs.generated.models.Configurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConfigurationsImpl implements Configurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationsImpl.class); + + private final ConfigurationsClient innerClient; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public ConfigurationsImpl( + ConfigurationsClient innerClient, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ClusterQuotaConfigurationProperties patch( + String resourceGroupName, String clusterName, ClusterQuotaConfigurationPropertiesInner parameters) { + ClusterQuotaConfigurationPropertiesInner inner = + this.serviceClient().patch(resourceGroupName, clusterName, parameters); + if (inner != null) { + return new ClusterQuotaConfigurationPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response patchWithResponse( + String resourceGroupName, + String clusterName, + ClusterQuotaConfigurationPropertiesInner parameters, + Context context) { + Response inner = + this.serviceClient().patchWithResponse(resourceGroupName, clusterName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterQuotaConfigurationPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterQuotaConfigurationProperties get(String resourceGroupName, String clusterName) { + ClusterQuotaConfigurationPropertiesInner inner = this.serviceClient().get(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterQuotaConfigurationPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterQuotaConfigurationPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupImpl.java new file mode 100644 index 0000000000000..60b8bbcee2575 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ConsumerGroupInner; +import com.azure.resourcemanager.eventhubs.generated.models.ConsumerGroup; +import java.time.OffsetDateTime; + +public final class ConsumerGroupImpl implements ConsumerGroup, ConsumerGroup.Definition, ConsumerGroup.Update { + private ConsumerGroupInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public String userMetadata() { + return this.innerModel().userMetadata(); + } + + public ConsumerGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String eventHubName; + + private String consumerGroupName; + + public ConsumerGroupImpl withExistingEventhub(String resourceGroupName, String namespaceName, String eventHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.eventHubName = eventHubName; + return this; + } + + public ConsumerGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getConsumerGroups() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ConsumerGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConsumerGroups() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + ConsumerGroupImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new ConsumerGroupInner(); + this.serviceManager = serviceManager; + this.consumerGroupName = name; + } + + public ConsumerGroupImpl update() { + return this; + } + + public ConsumerGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConsumerGroups() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ConsumerGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConsumerGroups() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + ConsumerGroupImpl( + ConsumerGroupInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.eventHubName = Utils.getValueFromIdByName(innerObject.id(), "eventhubs"); + this.consumerGroupName = Utils.getValueFromIdByName(innerObject.id(), "consumergroups"); + } + + public ConsumerGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConsumerGroups() + .getWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, Context.NONE) + .getValue(); + return this; + } + + public ConsumerGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConsumerGroups() + .getWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context) + .getValue(); + return this; + } + + public ConsumerGroupImpl withUserMetadata(String userMetadata) { + this.innerModel().withUserMetadata(userMetadata); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsClientImpl.java new file mode 100644 index 0000000000000..32d2a5a518934 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsClientImpl.java @@ -0,0 +1,1071 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.ConsumerGroupsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ConsumerGroupInner; +import com.azure.resourcemanager.eventhubs.generated.models.ConsumerGroupListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConsumerGroupsClient. */ +public final class ConsumerGroupsClientImpl implements ConsumerGroupsClient { + private final ClientLogger logger = new ClientLogger(ConsumerGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConsumerGroupsService service; + + /** The service client containing this operation class. */ + private final EventHubManagementClientImpl client; + + /** + * Initializes an instance of ConsumerGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConsumerGroupsClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy.create(ConsumerGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientConsumerGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface ConsumerGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @PathParam("consumerGroupName") String consumerGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConsumerGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @PathParam("consumerGroupName") String consumerGroupName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @PathParam("consumerGroupName") String consumerGroupName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEventHub( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEventHubNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); + } + if (consumerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter consumerGroupName 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, + eventHubName, + consumerGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); + } + if (consumerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter consumerGroupName 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, + eventHubName, + consumerGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsumerGroupInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters) + .block(); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group name. + * @param parameters Parameters supplied to create or update a consumer group 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 single item in List or Get Consumer group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + ConsumerGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters, context) + .block(); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName) { + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); + } + if (consumerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter consumerGroupName 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, + eventHubName, + consumerGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, + String consumerGroupName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); + } + if (consumerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter consumerGroupName 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, + eventHubName, + consumerGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName) { + deleteAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).block(); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, + String consumerGroupName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context) + .block(); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); + } + if (consumerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter consumerGroupName 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, + eventHubName, + consumerGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null.")); + } + if (consumerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter consumerGroupName 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, + eventHubName, + consumerGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsumerGroupInner get( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return getAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).block(); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context).block(); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEventHubSinglePageAsync( + String resourceGroupName, String namespaceName, String eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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 + .listByEventHub( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + eventHubName, + 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 consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEventHubSinglePageAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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 + .listByEventHub( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + eventHubName, + 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 consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEventHubAsync( + String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top), + nextLink -> listByEventHubNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEventHubAsync( + String resourceGroupName, String namespaceName, String eventHubName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top), + nextLink -> listByEventHubNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEventHubAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + Integer skip, + Integer top, + Context context) { + return new PagedFlux<>( + () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top, context), + nextLink -> listByEventHubNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEventHub( + String resourceGroupName, String namespaceName, String eventHubName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top)); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEventHub( + String resourceGroupName, + String namespaceName, + String eventHubName, + Integer skip, + Integer top, + Context context) { + return new PagedIterable<>( + listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top, 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 the result to the List Consumer Group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEventHubNextSinglePageAsync(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.listByEventHubNext(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 to the List Consumer Group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEventHubNextSinglePageAsync( + 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 + .listByEventHubNext(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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsImpl.java new file mode 100644 index 0000000000000..0640089693991 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.ConsumerGroupsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ConsumerGroupInner; +import com.azure.resourcemanager.eventhubs.generated.models.ConsumerGroup; +import com.azure.resourcemanager.eventhubs.generated.models.ConsumerGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConsumerGroupsImpl implements ConsumerGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupsImpl.class); + + private final ConsumerGroupsClient innerClient; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public ConsumerGroupsImpl( + ConsumerGroupsClient innerClient, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + this.serviceClient().delete(resourceGroupName, namespaceName, eventHubName, consumerGroupName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context); + } + + public ConsumerGroup get( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + ConsumerGroupInner inner = + this.serviceClient().get(resourceGroupName, namespaceName, eventHubName, consumerGroupName); + if (inner != null) { + return new ConsumerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String consumerGroupName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConsumerGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByEventHub( + String resourceGroupName, String namespaceName, String eventHubName) { + PagedIterable inner = + this.serviceClient().listByEventHub(resourceGroupName, namespaceName, eventHubName); + return Utils.mapPage(inner, inner1 -> new ConsumerGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByEventHub( + String resourceGroupName, + String namespaceName, + String eventHubName, + Integer skip, + Integer top, + Context context) { + PagedIterable inner = + this.serviceClient().listByEventHub(resourceGroupName, namespaceName, eventHubName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new ConsumerGroupImpl(inner1, this.manager())); + } + + public ConsumerGroup 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + String consumerGroupName = Utils.getValueFromIdByName(id, "consumergroups"); + if (consumerGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'consumergroups'.", id))); + } + return this + .getWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + String consumerGroupName = Utils.getValueFromIdByName(id, "consumergroups"); + if (consumerGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'consumergroups'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + String consumerGroupName = Utils.getValueFromIdByName(id, "consumergroups"); + if (consumerGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'consumergroups'.", id))); + } + this + .deleteWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + String consumerGroupName = Utils.getValueFromIdByName(id, "consumergroups"); + if (consumerGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'consumergroups'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context); + } + + private ConsumerGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public ConsumerGroupImpl define(String name) { + return new ConsumerGroupImpl(name, this.manager()); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsClientImpl.java new file mode 100644 index 0000000000000..af402bcc0aa55 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsClientImpl.java @@ -0,0 +1,2115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.ArmDisasterRecoveryListResult; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; +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 EventHubManagementClientImpl client; + + /** + * Initializes an instance of DisasterRecoveryConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DisasterRecoveryConfigsClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy + .create(DisasterRecoveryConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientDisasterRecoveryConfigs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface DisasterRecoveryConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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.EventHub/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.EventHub/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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @BodyParam("application/json") CheckNameAvailabilityParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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.EventHub/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.EventHub/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.EventHub/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.EventHub/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.EventHub/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, + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block(); + } + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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(); + } + + /** + * 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 (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(), + resourceGroupName, + namespaceName, + 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 (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(), + resourceGroupName, + namespaceName, + 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 Alias 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 Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + 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 + .failOver( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + 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 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, 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 + .failOver( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias) + .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) { + failOverAsync(resourceGroupName, namespaceName, alias).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 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, Context context) { + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, 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 from 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 from 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 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)); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsImpl.java new file mode 100644 index 0000000000000..0fb8604e231b4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessKeys; +import com.azure.resourcemanager.eventhubs.generated.models.ArmDisasterRecovery; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRule; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.eventhubs.generated.models.DisasterRecoveryConfigs; +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.eventhubs.generated.EventHubsManager serviceManager; + + public DisasterRecoveryConfigsImpl( + DisasterRecoveryConfigsClient innerClient, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, alias); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(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 AuthorizationRuleImpl(inner1, this.manager())); + } + + public AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + AuthorizationRuleInner inner = + this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName); + if (inner != null) { + return new AuthorizationRuleImpl(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 AuthorizationRuleImpl(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 CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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, CheckNameAvailabilityParameter 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, Context context) { + return this.serviceClient().failOverWithResponse(resourceGroupName, namespaceName, alias, context); + } + + 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public ArmDisasterRecoveryImpl define(String name) { + return new ArmDisasterRecoveryImpl(name, this.manager()); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceIdListResultImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceIdListResultImpl.java new file mode 100644 index 0000000000000..b12554185aacb --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceIdListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceIdListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespaceIdContainer; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespaceIdListResult; +import java.util.Collections; +import java.util.List; + +public final class EHNamespaceIdListResultImpl implements EHNamespaceIdListResult { + private EHNamespaceIdListResultInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + EHNamespaceIdListResultImpl( + EHNamespaceIdListResultInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 EHNamespaceIdListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceImpl.java new file mode 100644 index 0000000000000..69b9650cbfd3a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespace; +import com.azure.resourcemanager.eventhubs.generated.models.Encryption; +import com.azure.resourcemanager.eventhubs.generated.models.Identity; +import com.azure.resourcemanager.eventhubs.generated.models.Sku; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class EHNamespaceImpl implements EHNamespace, EHNamespace.Definition, EHNamespace.Update { + private EHNamespaceInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + 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 clusterArmId() { + return this.innerModel().clusterArmId(); + } + + public String metricId() { + return this.innerModel().metricId(); + } + + public Boolean isAutoInflateEnabled() { + return this.innerModel().isAutoInflateEnabled(); + } + + public Integer maximumThroughputUnits() { + return this.innerModel().maximumThroughputUnits(); + } + + public Boolean kafkaEnabled() { + return this.innerModel().kafkaEnabled(); + } + + public Boolean zoneRedundant() { + return this.innerModel().zoneRedundant(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public EHNamespaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + public EHNamespaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EHNamespace create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), Context.NONE); + return this; + } + + public EHNamespace create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), context); + return this; + } + + EHNamespaceImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new EHNamespaceInner(); + this.serviceManager = serviceManager; + this.namespaceName = name; + } + + public EHNamespaceImpl update() { + return this; + } + + public EHNamespace apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EHNamespace apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, this.innerModel(), context) + .getValue(); + return this; + } + + EHNamespaceImpl( + EHNamespaceInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + } + + public EHNamespace refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE) + .getValue(); + return this; + } + + public EHNamespace refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, context) + .getValue(); + return this; + } + + public EHNamespaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EHNamespaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EHNamespaceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public EHNamespaceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public EHNamespaceImpl withIdentity(Identity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public EHNamespaceImpl withClusterArmId(String clusterArmId) { + this.innerModel().withClusterArmId(clusterArmId); + return this; + } + + public EHNamespaceImpl withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { + this.innerModel().withIsAutoInflateEnabled(isAutoInflateEnabled); + return this; + } + + public EHNamespaceImpl withMaximumThroughputUnits(Integer maximumThroughputUnits) { + this.innerModel().withMaximumThroughputUnits(maximumThroughputUnits); + return this; + } + + public EHNamespaceImpl withKafkaEnabled(Boolean kafkaEnabled) { + this.innerModel().withKafkaEnabled(kafkaEnabled); + return this; + } + + public EHNamespaceImpl withZoneRedundant(Boolean zoneRedundant) { + this.innerModel().withZoneRedundant(zoneRedundant); + return this; + } + + public EHNamespaceImpl withEncryption(Encryption encryption) { + this.innerModel().withEncryption(encryption); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubManagementClientBuilder.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubManagementClientBuilder.java new file mode 100644 index 0000000000000..193b1dee6b2cf --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubManagementClientBuilder.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.eventhubs.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 EventHubManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {EventHubManagementClientImpl.class}) +public final class EventHubManagementClientBuilder { + /* + * 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 EventHubManagementClientBuilder. + */ + public EventHubManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the EventHubManagementClientBuilder. + */ + public EventHubManagementClientBuilder 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 EventHubManagementClientBuilder. + */ + public EventHubManagementClientBuilder 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 EventHubManagementClientBuilder. + */ + public EventHubManagementClientBuilder 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 EventHubManagementClientBuilder. + */ + public EventHubManagementClientBuilder 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 EventHubManagementClientBuilder. + */ + public EventHubManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of EventHubManagementClientImpl with the provided parameters. + * + * @return an instance of EventHubManagementClientImpl. + */ + public EventHubManagementClientImpl 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(); + } + EventHubManagementClientImpl client = + new EventHubManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubManagementClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubManagementClientImpl.java new file mode 100644 index 0000000000000..03141c535d093 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubManagementClientImpl.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.eventhubs.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.eventhubs.generated.fluent.ClustersClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.ConfigurationsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.ConsumerGroupsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.EventHubManagementClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.EventHubsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.OperationsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.RegionsClient; +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 EventHubManagementClientImpl type. */ +@ServiceClient(builder = EventHubManagementClientBuilder.class) +public final class EventHubManagementClientImpl implements EventHubManagementClient { + private final ClientLogger logger = new ClientLogger(EventHubManagementClientImpl.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 ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** 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 ConfigurationsClient object to access its operations. */ + private final ConfigurationsClient configurations; + + /** + * Gets the ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + public ConfigurationsClient getConfigurations() { + return this.configurations; + } + + /** 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 EventHubsClient object to access its operations. */ + private final EventHubsClient eventHubs; + + /** + * Gets the EventHubsClient object to access its operations. + * + * @return the EventHubsClient object. + */ + public EventHubsClient getEventHubs() { + return this.eventHubs; + } + + /** The ConsumerGroupsClient object to access its operations. */ + private final ConsumerGroupsClient consumerGroups; + + /** + * Gets the ConsumerGroupsClient object to access its operations. + * + * @return the ConsumerGroupsClient object. + */ + public ConsumerGroupsClient getConsumerGroups() { + return this.consumerGroups; + } + + /** 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 RegionsClient object to access its operations. */ + private final RegionsClient regions; + + /** + * Gets the RegionsClient object to access its operations. + * + * @return the RegionsClient object. + */ + public RegionsClient getRegions() { + return this.regions; + } + + /** + * Initializes an instance of EventHubManagementClient 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. + */ + EventHubManagementClientImpl( + 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 = "2018-01-01-preview"; + this.clusters = new ClustersClientImpl(this); + this.namespaces = new NamespacesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.configurations = new ConfigurationsClientImpl(this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsClientImpl(this); + this.eventHubs = new EventHubsClientImpl(this); + this.consumerGroups = new ConsumerGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.regions = new RegionsClientImpl(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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsClientImpl.java new file mode 100644 index 0000000000000..c2bd63b12c312 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsClientImpl.java @@ -0,0 +1,2342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.EventHubsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.eventhubs.generated.models.EventHubListResult; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EventHubsClient. */ +public final class EventHubsClientImpl implements EventHubsClient { + private final ClientLogger logger = new ClientLogger(EventHubsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EventHubsService service; + + /** The service client containing this operation class. */ + private final EventHubManagementClientImpl client; + + /** + * Initializes an instance of EventHubsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EventHubsClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy.create(EventHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientEventHubs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface EventHubsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs") + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") EventhubInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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.EventHub/namespaces" + + "/{namespaceName}/eventhubs/{eventHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("eventHubName") String eventHubName, + @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 the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String eventHubName) { + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + 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 an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + 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 an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String eventHubName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName)); + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + return new PagedIterable<>( + listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName, context)); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) + .block(); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block(); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context) + .block(); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, String authorizationRuleName) { + deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block(); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context) + .block(); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return listKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block(); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context) + .block(); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) + .block(); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @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/EventHub Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Gets all the Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 Event Hubs 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 or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String eventHubName, EventhubInner 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String eventHubName, + EventhubInner 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventhubInner createOrUpdate( + String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, parameters).block(); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param parameters Parameters supplied to create an Event Hub 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 single item in List or Get Event Hub operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + EventhubInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters, context) + .block(); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName) { + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName) { + deleteAsync(resourceGroupName, namespaceName, eventHubName).block(); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, context).block(); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String eventHubName) { + 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String eventHubName, 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 (eventHubName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventHubName 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, + eventHubName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String eventHubName) { + return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName) { + return getAsync(resourceGroupName, namespaceName, eventHubName).block(); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, 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 from 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 from 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 result of the List EventHubs 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 result of the List EventHubs 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsImpl.java new file mode 100644 index 0000000000000..02a154f7a1991 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsImpl.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.eventhubs.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.eventhubs.generated.fluent.EventHubsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessKeys; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRule; +import com.azure.resourcemanager.eventhubs.generated.models.EventHubs; +import com.azure.resourcemanager.eventhubs.generated.models.Eventhub; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EventHubsImpl implements EventHubs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventHubsImpl.class); + + private final EventHubsClient innerClient; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public EventHubsImpl( + EventHubsClient innerClient, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, eventHubName); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, eventHubName, context); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + } + + public AuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { + AuthorizationRuleInner inner = + this + .serviceClient() + .createOrUpdateAuthorizationRule( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters); + if (inner != null) { + return new AuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + AuthorizationRuleInner inner = + this + .serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + if (inner != null) { + return new AuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + this + .serviceClient() + .deleteAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context); + } + + public AccessKeys listKeys( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + AccessKeysInner inner = + this.serviceClient().listKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, eventHubName, 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 eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this + .serviceClient() + .regenerateKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, eventHubName, 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 EventhubImpl(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 EventhubImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String eventHubName) { + this.serviceClient().delete(resourceGroupName, namespaceName, eventHubName); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, eventHubName, context); + } + + public Eventhub get(String resourceGroupName, String namespaceName, String eventHubName) { + EventhubInner inner = this.serviceClient().get(resourceGroupName, namespaceName, eventHubName); + if (inner != null) { + return new EventhubImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, eventHubName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventhubImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Eventhub 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, eventHubName, 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, eventHubName, 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, eventHubName, 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 eventHubName = Utils.getValueFromIdByName(id, "eventhubs"); + if (eventHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventhubs'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, eventHubName, context); + } + + private EventHubsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public EventhubImpl define(String name) { + return new EventhubImpl(name, this.manager()); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventhubImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventhubImpl.java new file mode 100644 index 0000000000000..85411d465566b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventhubImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner; +import com.azure.resourcemanager.eventhubs.generated.models.CaptureDescription; +import com.azure.resourcemanager.eventhubs.generated.models.EntityStatus; +import com.azure.resourcemanager.eventhubs.generated.models.Eventhub; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class EventhubImpl implements Eventhub, Eventhub.Definition, Eventhub.Update { + private EventhubInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List partitionIds() { + List inner = this.innerModel().partitionIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public Long messageRetentionInDays() { + return this.innerModel().messageRetentionInDays(); + } + + public Long partitionCount() { + return this.innerModel().partitionCount(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public CaptureDescription captureDescription() { + return this.innerModel().captureDescription(); + } + + public EventhubInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String eventHubName; + + public EventhubImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public Eventhub create() { + this.innerObject = + serviceManager + .serviceClient() + .getEventHubs() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, eventHubName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Eventhub create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEventHubs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, eventHubName, this.innerModel(), context) + .getValue(); + return this; + } + + EventhubImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new EventhubInner(); + this.serviceManager = serviceManager; + this.eventHubName = name; + } + + public EventhubImpl update() { + return this; + } + + public Eventhub apply() { + this.innerObject = + serviceManager + .serviceClient() + .getEventHubs() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, eventHubName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Eventhub apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEventHubs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, eventHubName, this.innerModel(), context) + .getValue(); + return this; + } + + EventhubImpl( + EventhubInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.eventHubName = Utils.getValueFromIdByName(innerObject.id(), "eventhubs"); + } + + public Eventhub refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEventHubs() + .getWithResponse(resourceGroupName, namespaceName, eventHubName, Context.NONE) + .getValue(); + return this; + } + + public Eventhub refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEventHubs() + .getWithResponse(resourceGroupName, namespaceName, eventHubName, context) + .getValue(); + return this; + } + + public EventhubImpl withMessageRetentionInDays(Long messageRetentionInDays) { + this.innerModel().withMessageRetentionInDays(messageRetentionInDays); + return this; + } + + public EventhubImpl withPartitionCount(Long partitionCount) { + this.innerModel().withPartitionCount(partitionCount); + return this; + } + + public EventhubImpl withStatus(EntityStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public EventhubImpl withCaptureDescription(CaptureDescription captureDescription) { + this.innerModel().withCaptureDescription(captureDescription); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/IpFilterRuleImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/IpFilterRuleImpl.java new file mode 100644 index 0000000000000..1171fd7d77ffc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/IpFilterRuleImpl.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.eventhubs.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.IpAction; +import com.azure.resourcemanager.eventhubs.generated.models.IpFilterRule; + +public final class IpFilterRuleImpl implements IpFilterRule, IpFilterRule.Definition, IpFilterRule.Update { + private IpFilterRuleInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String ipMask() { + return this.innerModel().ipMask(); + } + + public IpAction action() { + return this.innerModel().action(); + } + + public String filterName() { + return this.innerModel().filterName(); + } + + public IpFilterRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String ipFilterRuleName; + + public IpFilterRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public IpFilterRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateIpFilterRuleWithResponse( + resourceGroupName, namespaceName, ipFilterRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public IpFilterRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateIpFilterRuleWithResponse( + resourceGroupName, namespaceName, ipFilterRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + IpFilterRuleImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new IpFilterRuleInner(); + this.serviceManager = serviceManager; + this.ipFilterRuleName = name; + } + + public IpFilterRuleImpl update() { + return this; + } + + public IpFilterRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateIpFilterRuleWithResponse( + resourceGroupName, namespaceName, ipFilterRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public IpFilterRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateIpFilterRuleWithResponse( + resourceGroupName, namespaceName, ipFilterRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + IpFilterRuleImpl( + IpFilterRuleInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.ipFilterRuleName = Utils.getValueFromIdByName(innerObject.id(), "ipfilterrules"); + } + + public IpFilterRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, Context.NONE) + .getValue(); + return this; + } + + public IpFilterRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, context) + .getValue(); + return this; + } + + public IpFilterRuleImpl withIpMask(String ipMask) { + this.innerModel().withIpMask(ipMask); + return this; + } + + public IpFilterRuleImpl withAction(IpAction action) { + this.innerModel().withAction(action); + return this; + } + + public IpFilterRuleImpl withFilterName(String filterName) { + this.innerModel().withFilterName(filterName); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/MessagingRegionsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/MessagingRegionsImpl.java new file mode 100644 index 0000000000000..0341191ccf2ea --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/MessagingRegionsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.MessagingRegionsInner; +import com.azure.resourcemanager.eventhubs.generated.models.MessagingRegions; +import com.azure.resourcemanager.eventhubs.generated.models.MessagingRegionsProperties; +import java.util.Collections; +import java.util.Map; + +public final class MessagingRegionsImpl implements MessagingRegions { + private MessagingRegionsInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + MessagingRegionsImpl( + MessagingRegionsInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 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 MessagingRegionsProperties properties() { + return this.innerModel().properties(); + } + + public MessagingRegionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesClientImpl.java new file mode 100644 index 0000000000000..a0709b8dbc93a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesClientImpl.java @@ -0,0 +1,4925 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespaceListResult; +import com.azure.resourcemanager.eventhubs.generated.models.IpFilterRuleListResult; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.eventhubs.generated.models.VirtualNetworkRuleListResult; +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 EventHubManagementClientImpl client; + + /** + * Initializes an instance of NamespacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NamespacesClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientNamespaces to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface NamespacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/ipfilterrules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listIpFilterRules( + @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.EventHub/namespaces" + + "/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateIpFilterRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("ipFilterRuleName") String ipFilterRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IpFilterRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteIpFilterRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("ipFilterRuleName") String ipFilterRuleName, + @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.EventHub/namespaces" + + "/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getIpFilterRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("ipFilterRuleName") String ipFilterRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/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.EventHub" + + "/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.EventHub/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") EHNamespaceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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.EventHub/namespaces" + + "/{namespaceName}") + @ExpectedResponses({200, 201}) + @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.EventHub/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") EHNamespaceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/virtualnetworkrules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualNetworkRules( + @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.EventHub/namespaces" + + "/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateVirtualNetworkRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("virtualNetworkRuleName") String virtualNetworkRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteVirtualNetworkRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("virtualNetworkRuleName") String virtualNetworkRuleName, + @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.EventHub/namespaces" + + "/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualNetworkRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("virtualNetworkRuleName") String virtualNetworkRuleName, + @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.EventHub/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.EventHub/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.EventHub/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.EventHub/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") AuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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.EventHub/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.EventHub/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.EventHub/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.EventHub/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailabilityParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listIpFilterRulesNext( + @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> 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> listVirtualNetworkRulesNext( + @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 a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listIpFilterRulesSinglePageAsync( + 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 + .listIpFilterRules( + 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 a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listIpFilterRulesSinglePageAsync( + 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 + .listIpFilterRules( + 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 a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listIpFilterRulesAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listIpFilterRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listIpFilterRulesAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listIpFilterRulesSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listIpFilterRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listIpFilterRules(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listIpFilterRulesAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param 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 list of IP Filter rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listIpFilterRules( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listIpFilterRulesAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateIpFilterRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner 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 (ipFilterRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFilterRuleName 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 + .createOrUpdateIpFilterRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + ipFilterRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @param 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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateIpFilterRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String ipFilterRuleName, + IpFilterRuleInner 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 (ipFilterRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFilterRuleName 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 + .createOrUpdateIpFilterRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + ipFilterRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateIpFilterRuleAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + return createOrUpdateIpFilterRuleWithResponseAsync( + resourceGroupName, namespaceName, ipFilterRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpFilterRuleInner createOrUpdateIpFilterRule( + String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + return createOrUpdateIpFilterRuleAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).block(); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @param 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 a List or Get IpFilterRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateIpFilterRuleWithResponse( + String resourceGroupName, + String namespaceName, + String ipFilterRuleName, + IpFilterRuleInner parameters, + Context context) { + return createOrUpdateIpFilterRuleWithResponseAsync( + resourceGroupName, namespaceName, ipFilterRuleName, parameters, context) + .block(); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> deleteIpFilterRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName) { + 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 (ipFilterRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFilterRuleName 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 + .deleteIpFilterRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + ipFilterRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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> deleteIpFilterRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName, 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 (ipFilterRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFilterRuleName 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 + .deleteIpFilterRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + ipFilterRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteIpFilterRuleAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return deleteIpFilterRuleWithResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + deleteIpFilterRuleAsync(resourceGroupName, namespaceName, ipFilterRuleName).block(); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 deleteIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context) { + return deleteIpFilterRuleWithResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, context).block(); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getIpFilterRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName) { + 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 (ipFilterRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFilterRuleName 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 + .getIpFilterRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + ipFilterRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getIpFilterRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName, 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 (ipFilterRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFilterRuleName 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 + .getIpFilterRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + ipFilterRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getIpFilterRuleAsync( + String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return getIpFilterRuleWithResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpFilterRuleInner getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return getIpFilterRuleAsync(resourceGroupName, namespaceName, ipFilterRuleName).block(); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 IpFilterRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context) { + return getIpFilterRuleWithResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, context).block(); + } + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @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())); + } + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @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)); + } + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists 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 response of the List Namespace operation. + */ + @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())); + } + + /** + * Lists 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 response of the List Namespace operation. + */ + @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)); + } + + /** + * Lists 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 response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists 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 response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists 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 response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists 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 response of the List Namespace operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner 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 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner 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 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EHNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EHNamespaceInner.class, EHNamespaceInner.class, Context.NONE); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EHNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EHNamespaceInner.class, EHNamespaceInner.class, context); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EHNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EHNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EHNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * Creates or updates a 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 for creating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EHNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, EHNamespaceInner 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 the description of 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 the description of 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 the description of 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 the description of 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 the description of 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 the description of 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 the description of 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 the description of the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupAsync(resourceGroupName, namespaceName).block(); + } + + /** + * Gets the description of 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 the description of the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner 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())); + } + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner 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); + } + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return updateAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * Creates or updates a 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 for updating 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 single Namespace item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualNetworkRulesSinglePageAsync( + 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 + .listVirtualNetworkRules( + 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 a list of VirtualNetwork 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 a list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualNetworkRulesSinglePageAsync( + 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 + .listVirtualNetworkRules( + 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 a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualNetworkRulesAsync( + String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listVirtualNetworkRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualNetworkRulesAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listVirtualNetworkRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualNetworkRules( + String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listVirtualNetworkRulesAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @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 list of VirtualNetwork rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualNetworkRules( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listVirtualNetworkRulesAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateVirtualNetworkRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner 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 (virtualNetworkRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkRuleName 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 + .createOrUpdateVirtualNetworkRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + virtualNetworkRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateVirtualNetworkRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner 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 (virtualNetworkRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkRuleName 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 + .createOrUpdateVirtualNetworkRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + virtualNetworkRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateVirtualNetworkRuleAsync( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner parameters) { + return createOrUpdateVirtualNetworkRuleWithResponseAsync( + resourceGroupName, namespaceName, virtualNetworkRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner parameters) { + return createOrUpdateVirtualNetworkRuleAsync( + resourceGroupName, namespaceName, virtualNetworkRuleName, parameters) + .block(); + } + + /** + * Creates or updates an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @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 a List or Get VirtualNetworkRules operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateVirtualNetworkRuleWithResponse( + String resourceGroupName, + String namespaceName, + String virtualNetworkRuleName, + VirtualNetworkRuleInner parameters, + Context context) { + return createOrUpdateVirtualNetworkRuleWithResponseAsync( + resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, context) + .block(); + } + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> deleteVirtualNetworkRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + 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 (virtualNetworkRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkRuleName 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 + .deleteVirtualNetworkRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + virtualNetworkRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param 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> deleteVirtualNetworkRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, 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 (virtualNetworkRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkRuleName 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 + .deleteVirtualNetworkRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + virtualNetworkRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteVirtualNetworkRuleAsync( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return deleteVirtualNetworkRuleWithResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteVirtualNetworkRule( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + deleteVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).block(); + } + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param 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 deleteVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, Context context) { + return deleteVirtualNetworkRuleWithResponseAsync( + resourceGroupName, namespaceName, virtualNetworkRuleName, context) + .block(); + } + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualNetworkRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + 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 (virtualNetworkRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkRuleName 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 + .getVirtualNetworkRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + virtualNetworkRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualNetworkRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, 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 (virtualNetworkRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkRuleName 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 + .getVirtualNetworkRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + virtualNetworkRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualNetworkRuleAsync( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return getVirtualNetworkRuleWithResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkRuleInner getVirtualNetworkRule( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return getVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).block(); + } + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, Context context) { + return getVirtualNetworkRuleWithResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, 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 topic 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 topic 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 topic 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 topic 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 topic 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of 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 a list of authorization rules for a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets a list of 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 a list of 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 AuthorizationRule 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 AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner 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 AuthorizationRule 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 AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner 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 AuthorizationRule 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 AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner 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 AuthorizationRule 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 AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .block(); + } + + /** + * Creates or updates an AuthorizationRule 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 AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Deletes an AuthorizationRule 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an AuthorizationRule 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 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 an AuthorizationRule 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an AuthorizationRule 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 an AuthorizationRule 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 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + } + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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 specified 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 required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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/EventHub 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 specified 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 required to regenerate the connection string. + * @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/EventHub 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 specified 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 required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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/EventHub 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 specified 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 required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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/EventHub 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 specified 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 required to regenerate the connection string. + * @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/EventHub 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailabilityParameter 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailabilityParameter 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + CheckNameAvailabilityParameter 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabilityParameter 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 the Result of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityParameter 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 from the List namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listIpFilterRulesNextSinglePageAsync(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.listIpFilterRulesNext(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 from the List namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listIpFilterRulesNextSinglePageAsync( + 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 + .listIpFilterRulesNext(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> 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 from the List namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualNetworkRulesNextSinglePageAsync(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.listVirtualNetworkRulesNext(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 from the List namespace operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualNetworkRulesNextSinglePageAsync( + 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 + .listVirtualNetworkRulesNext(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 from 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 from 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesImpl.java new file mode 100644 index 0000000000000..a0b04c2d10ecf --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesImpl.java @@ -0,0 +1,832 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessKeys; +import com.azure.resourcemanager.eventhubs.generated.models.AuthorizationRule; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespace; +import com.azure.resourcemanager.eventhubs.generated.models.IpFilterRule; +import com.azure.resourcemanager.eventhubs.generated.models.Namespaces; +import com.azure.resourcemanager.eventhubs.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.eventhubs.generated.models.VirtualNetworkRule; +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.eventhubs.generated.EventHubsManager serviceManager; + + public NamespacesImpl( + NamespacesClient innerClient, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listIpFilterRules(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listIpFilterRules(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new IpFilterRuleImpl(inner1, this.manager())); + } + + public PagedIterable listIpFilterRules( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listIpFilterRules(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new IpFilterRuleImpl(inner1, this.manager())); + } + + public void deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + this.serviceClient().deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName); + } + + public Response deleteIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context) { + return this + .serviceClient() + .deleteIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, context); + } + + public IpFilterRule getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + IpFilterRuleInner inner = + this.serviceClient().getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName); + if (inner != null) { + return new IpFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context) { + Response inner = + this + .serviceClient() + .getIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpFilterRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new EHNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new EHNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new EHNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new EHNamespaceImpl(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 EHNamespace getByResourceGroup(String resourceGroupName, String namespaceName) { + EHNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); + if (inner != null) { + return new EHNamespaceImpl(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 EHNamespaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listVirtualNetworkRules(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listVirtualNetworkRules(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualNetworkRules( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listVirtualNetworkRules(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager())); + } + + public void deleteVirtualNetworkRule( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + this.serviceClient().deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName); + } + + public Response deleteVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, Context context) { + return this + .serviceClient() + .deleteVirtualNetworkRuleWithResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, context); + } + + public VirtualNetworkRule getVirtualNetworkRule( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + VirtualNetworkRuleInner inner = + this.serviceClient().getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName); + if (inner != null) { + return new VirtualNetworkRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, Context context) { + Response inner = + this + .serviceClient() + .getVirtualNetworkRuleWithResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkRuleImpl(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 listAuthorizationRules(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(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 AuthorizationRuleImpl(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 AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + AuthorizationRuleInner inner = + this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + if (inner != null) { + return new AuthorizationRuleImpl(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 AuthorizationRuleImpl(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(CheckNameAvailabilityParameter parameters) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityParameter 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 EHNamespace 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 IpFilterRule getIpFilterRuleById(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 ipFilterRuleName = Utils.getValueFromIdByName(id, "ipfilterrules"); + if (ipFilterRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipfilterrules'.", id))); + } + return this + .getIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, Context.NONE) + .getValue(); + } + + public Response getIpFilterRuleByIdWithResponse(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 ipFilterRuleName = Utils.getValueFromIdByName(id, "ipfilterrules"); + if (ipFilterRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipfilterrules'.", id))); + } + return this.getIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, context); + } + + public VirtualNetworkRule getVirtualNetworkRuleById(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 virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualnetworkrules"); + if (virtualNetworkRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualnetworkrules'.", id))); + } + return this + .getVirtualNetworkRuleWithResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, Context.NONE) + .getValue(); + } + + public Response getVirtualNetworkRuleByIdWithResponse(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 virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualnetworkrules"); + if (virtualNetworkRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualnetworkrules'.", id))); + } + return this + .getVirtualNetworkRuleWithResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, context); + } + + public AuthorizationRule 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 deleteIpFilterRuleById(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 ipFilterRuleName = Utils.getValueFromIdByName(id, "ipfilterrules"); + if (ipFilterRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipfilterrules'.", id))); + } + this + .deleteIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, Context.NONE) + .getValue(); + } + + public Response deleteIpFilterRuleByIdWithResponse(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 ipFilterRuleName = Utils.getValueFromIdByName(id, "ipfilterrules"); + if (ipFilterRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipfilterrules'.", id))); + } + return this.deleteIpFilterRuleWithResponse(resourceGroupName, namespaceName, ipFilterRuleName, context); + } + + public void deleteVirtualNetworkRuleById(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 virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualnetworkrules"); + if (virtualNetworkRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualnetworkrules'.", id))); + } + this + .deleteVirtualNetworkRuleWithResponse( + resourceGroupName, namespaceName, virtualNetworkRuleName, Context.NONE) + .getValue(); + } + + public Response deleteVirtualNetworkRuleByIdWithResponse(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 virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualnetworkrules"); + if (virtualNetworkRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualnetworkrules'.", id))); + } + return this + .deleteVirtualNetworkRuleWithResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public EHNamespaceImpl define(String name) { + return new EHNamespaceImpl(name, this.manager()); + } + + public IpFilterRuleImpl defineIpFilterRule(String name) { + return new IpFilterRuleImpl(name, this.manager()); + } + + public VirtualNetworkRuleImpl defineVirtualNetworkRule(String name) { + return new VirtualNetworkRuleImpl(name, this.manager()); + } + + public AuthorizationRuleImpl defineAuthorizationRule(String name) { + return new AuthorizationRuleImpl(name, this.manager()); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NetworkRuleSetImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NetworkRuleSetImpl.java new file mode 100644 index 0000000000000..d2fd59d1e3bac --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NetworkRuleSetImpl.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.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.models.DefaultAction; +import com.azure.resourcemanager.eventhubs.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.eventhubs.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.eventhubs.generated.models.NetworkRuleSet; +import java.util.Collections; +import java.util.List; + +public final class NetworkRuleSetImpl implements NetworkRuleSet { + private NetworkRuleSetInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + NetworkRuleSetImpl( + NetworkRuleSetInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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 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 NetworkRuleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..fa3589ce43f17 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.eventhubs.generated.models.Operation; +import com.azure.resourcemanager.eventhubs.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..285378b86442f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.generated.fluent.OperationsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.eventhubs.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 EventHubManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.EventHub/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 Event Hub 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 Event Hub 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 Event Hub 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 Event Hub 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 Event Hub 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 Event Hub operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Event Hub 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 Event Hub operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Event Hub 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 Event Hub operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Event Hub 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 Event Hub 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 Event Hub 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 Event Hub 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..46784ca0dd2db --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.generated.fluent.OperationsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.eventhubs.generated.models.Operation; +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.EventHubsManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..c6f73cf360d8b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.eventhubs.generated.models.ConnectionState; +import com.azure.resourcemanager.eventhubs.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateEndpointConnection; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..91a0af8aec699 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.eventhubs.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 EventHubManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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.EventHub/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.EventHub/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.EventHub/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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 name. + * + * @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 name. + */ + @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 name. + * + * @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 name. + */ + @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 name. + * + * @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 name. + */ + @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 name. + * + * @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 name. + */ + @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 name. + * + * @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 name. + */ + @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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..0e9e190c893a0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.EventHubsManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..54468c9a88c5b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.eventhubs.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 EventHubManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..0d51eb2855c44 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.eventhubs.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.EventHubsManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 0000000000000..f38b8cdb5ade1 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.implementation; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.EventHubsManager serviceManager; + + PrivateLinkResourcesListResultImpl( + PrivateLinkResourcesListResultInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager 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.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/RegionsClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/RegionsClientImpl.java new file mode 100644 index 0000000000000..7f2e105900eea --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/RegionsClientImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.RegionsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.MessagingRegionsInner; +import com.azure.resourcemanager.eventhubs.generated.models.MessagingRegionsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegionsClient. */ +public final class RegionsClientImpl implements RegionsClient { + private final ClientLogger logger = new ClientLogger(RegionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RegionsService service; + + /** The service client containing this operation class. */ + private final EventHubManagementClientImpl client; + + /** + * Initializes an instance of RegionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegionsClientImpl(EventHubManagementClientImpl client) { + this.service = RestProxy.create(RegionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientRegions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface RegionsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySku( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("sku") String sku, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySkuNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuSinglePageAsync(String sku) { + 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 (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySku( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + sku, + 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 Regions for a given sku. + * + * @param sku The sku type. + * @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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuSinglePageAsync(String sku, 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 (sku == null) { + return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySku( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + sku, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySkuAsync(String sku) { + return new PagedFlux<>(() -> listBySkuSinglePageAsync(sku), nextLink -> listBySkuNextSinglePageAsync(nextLink)); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySkuAsync(String sku, Context context) { + return new PagedFlux<>( + () -> listBySkuSinglePageAsync(sku, context), nextLink -> listBySkuNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySku(String sku) { + return new PagedIterable<>(listBySkuAsync(sku)); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @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 Regions for a given sku. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySku(String sku, Context context) { + return new PagedIterable<>(listBySkuAsync(sku, 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 the response of the List MessagingRegions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuNextSinglePageAsync(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.listBySkuNext(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 MessagingRegions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySkuNextSinglePageAsync(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 + .listBySkuNext(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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/RegionsImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/RegionsImpl.java new file mode 100644 index 0000000000000..4bf862c8b6576 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/RegionsImpl.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.eventhubs.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.eventhubs.generated.fluent.RegionsClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.MessagingRegionsInner; +import com.azure.resourcemanager.eventhubs.generated.models.MessagingRegions; +import com.azure.resourcemanager.eventhubs.generated.models.Regions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RegionsImpl implements Regions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionsImpl.class); + + private final RegionsClient innerClient; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public RegionsImpl( + RegionsClient innerClient, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySku(String sku) { + PagedIterable inner = this.serviceClient().listBySku(sku); + return Utils.mapPage(inner, inner1 -> new MessagingRegionsImpl(inner1, this.manager())); + } + + public PagedIterable listBySku(String sku, Context context) { + PagedIterable inner = this.serviceClient().listBySku(sku, context); + return Utils.mapPage(inner, inner1 -> new MessagingRegionsImpl(inner1, this.manager())); + } + + private RegionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/Utils.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/Utils.java new file mode 100644 index 0000000000000..ea56d3c1efd59 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/VirtualNetworkRuleImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/VirtualNetworkRuleImpl.java new file mode 100644 index 0000000000000..f655ef626d326 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/VirtualNetworkRuleImpl.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.eventhubs.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.VirtualNetworkRule; + +public final class VirtualNetworkRuleImpl + implements VirtualNetworkRule, VirtualNetworkRule.Definition, VirtualNetworkRule.Update { + private VirtualNetworkRuleInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String virtualNetworkSubnetId() { + return this.innerModel().virtualNetworkSubnetId(); + } + + public VirtualNetworkRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String virtualNetworkRuleName; + + public VirtualNetworkRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public VirtualNetworkRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateVirtualNetworkRuleWithResponse( + resourceGroupName, namespaceName, virtualNetworkRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateVirtualNetworkRuleWithResponse( + resourceGroupName, namespaceName, virtualNetworkRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + VirtualNetworkRuleImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new VirtualNetworkRuleInner(); + this.serviceManager = serviceManager; + this.virtualNetworkRuleName = name; + } + + public VirtualNetworkRuleImpl update() { + return this; + } + + public VirtualNetworkRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateVirtualNetworkRuleWithResponse( + resourceGroupName, namespaceName, virtualNetworkRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateVirtualNetworkRuleWithResponse( + resourceGroupName, namespaceName, virtualNetworkRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + VirtualNetworkRuleImpl( + VirtualNetworkRuleInner innerObject, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.virtualNetworkRuleName = Utils.getValueFromIdByName(innerObject.id(), "virtualnetworkrules"); + } + + public VirtualNetworkRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getVirtualNetworkRuleWithResponse( + resourceGroupName, namespaceName, virtualNetworkRuleName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getVirtualNetworkRuleWithResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, context) + .getValue(); + return this; + } + + public VirtualNetworkRuleImpl withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.innerModel().withVirtualNetworkSubnetId(virtualNetworkSubnetId); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/package-info.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/package-info.java new file mode 100644 index 0000000000000..03cc8a720f4a7 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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 EventHubManagementClient. Azure Event Hubs client for managing Event Hubs + * Cluster, IPFilter Rules and VirtualNetworkRules resources. + */ +package com.azure.resourcemanager.eventhubs.generated.implementation; diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AccessKeys.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AccessKeys.java new file mode 100644 index 0000000000000..5fdd7f5212212 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.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 AuthorizationRule. + * + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * Gets the secondaryConnectionString property: Secondary connection string of the created namespace + * AuthorizationRule. + * + * @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 AuthorizationRule. + * + * @return the keyName value. + */ + String keyName(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.AccessKeysInner object. + * + * @return the inner object. + */ + AccessKeysInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AccessRights.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AccessRights.java new file mode 100644 index 0000000000000..50388133f1be1 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AccessRights.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.eventhubs.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessRights. */ +public final class AccessRights extends ExpandableStringEnum { + /** Static value Manage for AccessRights. */ + public static final AccessRights MANAGE = fromString("Manage"); + + /** Static value Send for AccessRights. */ + public static final AccessRights SEND = fromString("Send"); + + /** Static value Listen for AccessRights. */ + public static final AccessRights LISTEN = fromString("Listen"); + + /** + * Creates or finds a AccessRights from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRights. + */ + @JsonCreator + public static AccessRights fromString(String name) { + return fromString(name, AccessRights.class); + } + + /** @return known AccessRights values. */ + public static Collection values() { + return values(AccessRights.class); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ArmDisasterRecovery.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ArmDisasterRecovery.java new file mode 100644 index 0000000000000..4ffe49fcb23eb --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ArmDisasterRecovery.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.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 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 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: Alternate name specified when alias and namespace names are same. + * + * @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 pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.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: Alternate name specified when alias and namespace names are same.. + * + * @param alternateName Alternate name specified when alias and namespace names are same. + * @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: Alternate name specified when alias and namespace names are same.. + * + * @param alternateName Alternate name specified when alias and namespace names are same. + * @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 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(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ArmDisasterRecoveryListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ArmDisasterRecoveryListResult.java new file mode 100644 index 0000000000000..61d8914c4474b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRule.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRule.java new file mode 100644 index 0000000000000..4147b1f86567e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRule.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import java.util.List; + +/** An immutable client-side representation of AuthorizationRule. */ +public interface AuthorizationRule { + /** + * 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 rights property: The rights associated with the rule. + * + * @return the rights value. + */ + List rights(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner object. + * + * @return the inner object. + */ + AuthorizationRuleInner innerModel(); + + /** The entirety of the AuthorizationRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AuthorizationRule definition stages. */ + interface DefinitionStages { + /** The first stage of the AuthorizationRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AuthorizationRule 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 AuthorizationRule 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. + */ + AuthorizationRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AuthorizationRule create(Context context); + } + /** The stage of the AuthorizationRule 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 AuthorizationRule resource. + * + * @return the stage of resource update. + */ + AuthorizationRule.Update update(); + + /** The template for AuthorizationRule update. */ + interface Update extends UpdateStages.WithRights { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AuthorizationRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AuthorizationRule apply(Context context); + } + /** The AuthorizationRule update stages. */ + interface UpdateStages { + /** The stage of the AuthorizationRule 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. + */ + AuthorizationRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AuthorizationRule 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 specified Namespace. + * + * @param parameters Parameters required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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/EventHub Connection String. + */ + AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters); + + /** + * Regenerates the primary or secondary connection strings for the specified Namespace. + * + * @param parameters Parameters required to regenerate the connection string. + * @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/EventHub Connection String. + */ + Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRuleListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRuleListResult.java new file mode 100644 index 0000000000000..de317ec8c6481 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRuleListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List namespace operation. */ +@Fluent +public final class AuthorizationRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleListResult.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 an + * 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 AuthorizationRuleListResult object itself. + */ + public AuthorizationRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains an 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 an incomplete list of + * Authorization Rules. + * + * @param nextLink the nextLink value to set. + * @return the AuthorizationRuleListResult object itself. + */ + public AuthorizationRuleListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AvailableCluster.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AvailableCluster.java new file mode 100644 index 0000000000000..8f059f39e75aa --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AvailableCluster.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.eventhubs.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; + +/** Pre-provisioned and readily available Event Hubs Cluster count per region. */ +@Fluent +public final class AvailableCluster { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableCluster.class); + + /* + * Location fo the Available Cluster + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location property: Location fo the Available Cluster. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location fo the Available Cluster. + * + * @param location the location value to set. + * @return the AvailableCluster object itself. + */ + public AvailableCluster withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AvailableClustersList.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AvailableClustersList.java new file mode 100644 index 0000000000000..bf8f9a0dbfff5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AvailableClustersList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AvailableClustersListInner; +import java.util.List; + +/** An immutable client-side representation of AvailableClustersList. */ +public interface AvailableClustersList { + /** + * Gets the value property: The count of readily available and pre-provisioned Event Hubs Clusters per region. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.AvailableClustersListInner object. + * + * @return the inner object. + */ + AvailableClustersListInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CaptureDescription.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CaptureDescription.java new file mode 100644 index 0000000000000..1ce9721619995 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CaptureDescription.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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 capture description for eventhub. */ +@Fluent +public final class CaptureDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CaptureDescription.class); + + /* + * A value that indicates whether capture description is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Enumerates the possible values for the encoding format of capture + * description. Note: 'AvroDeflate' will be deprecated in New API Version + */ + @JsonProperty(value = "encoding") + private EncodingCaptureDescription encoding; + + /* + * The time window allows you to set the frequency with which the capture + * to Azure Blobs will happen, value should between 60 to 900 seconds + */ + @JsonProperty(value = "intervalInSeconds") + private Integer intervalInSeconds; + + /* + * The size window defines the amount of data built up in your Event Hub + * before an capture operation, value should be between 10485760 to + * 524288000 bytes + */ + @JsonProperty(value = "sizeLimitInBytes") + private Integer sizeLimitInBytes; + + /* + * Properties of Destination where capture will be stored. (Storage + * Account, Blob Names) + */ + @JsonProperty(value = "destination") + private Destination destination; + + /* + * A value that indicates whether to Skip Empty Archives + */ + @JsonProperty(value = "skipEmptyArchives") + private Boolean skipEmptyArchives; + + /** + * Get the enabled property: A value that indicates whether capture description is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A value that indicates whether capture description is enabled. + * + * @param enabled the enabled value to set. + * @return the CaptureDescription object itself. + */ + public CaptureDescription withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the encoding property: Enumerates the possible values for the encoding format of capture description. Note: + * 'AvroDeflate' will be deprecated in New API Version. + * + * @return the encoding value. + */ + public EncodingCaptureDescription encoding() { + return this.encoding; + } + + /** + * Set the encoding property: Enumerates the possible values for the encoding format of capture description. Note: + * 'AvroDeflate' will be deprecated in New API Version. + * + * @param encoding the encoding value to set. + * @return the CaptureDescription object itself. + */ + public CaptureDescription withEncoding(EncodingCaptureDescription encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the intervalInSeconds property: The time window allows you to set the frequency with which the capture to + * Azure Blobs will happen, value should between 60 to 900 seconds. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: The time window allows you to set the frequency with which the capture to + * Azure Blobs will happen, value should between 60 to 900 seconds. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the CaptureDescription object itself. + */ + public CaptureDescription withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the sizeLimitInBytes property: The size window defines the amount of data built up in your Event Hub before + * an capture operation, value should be between 10485760 to 524288000 bytes. + * + * @return the sizeLimitInBytes value. + */ + public Integer sizeLimitInBytes() { + return this.sizeLimitInBytes; + } + + /** + * Set the sizeLimitInBytes property: The size window defines the amount of data built up in your Event Hub before + * an capture operation, value should be between 10485760 to 524288000 bytes. + * + * @param sizeLimitInBytes the sizeLimitInBytes value to set. + * @return the CaptureDescription object itself. + */ + public CaptureDescription withSizeLimitInBytes(Integer sizeLimitInBytes) { + this.sizeLimitInBytes = sizeLimitInBytes; + return this; + } + + /** + * Get the destination property: Properties of Destination where capture will be stored. (Storage Account, Blob + * Names). + * + * @return the destination value. + */ + public Destination destination() { + return this.destination; + } + + /** + * Set the destination property: Properties of Destination where capture will be stored. (Storage Account, Blob + * Names). + * + * @param destination the destination value to set. + * @return the CaptureDescription object itself. + */ + public CaptureDescription withDestination(Destination destination) { + this.destination = destination; + return this; + } + + /** + * Get the skipEmptyArchives property: A value that indicates whether to Skip Empty Archives. + * + * @return the skipEmptyArchives value. + */ + public Boolean skipEmptyArchives() { + return this.skipEmptyArchives; + } + + /** + * Set the skipEmptyArchives property: A value that indicates whether to Skip Empty Archives. + * + * @param skipEmptyArchives the skipEmptyArchives value to set. + * @return the CaptureDescription object itself. + */ + public CaptureDescription withSkipEmptyArchives(Boolean skipEmptyArchives) { + this.skipEmptyArchives = skipEmptyArchives; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destination() != null) { + destination().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CheckNameAvailabilityParameter.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CheckNameAvailabilityParameter.java new file mode 100644 index 0000000000000..1eb71943440d6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CheckNameAvailabilityParameter.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.eventhubs.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; + +/** Parameter supplied to check Namespace name availability operation. */ +@Fluent +public final class CheckNameAvailabilityParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameter.class); + + /* + * Name to check the namespace name availability + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: Name to check the namespace name availability. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to check the namespace name availability. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityParameter object itself. + */ + public CheckNameAvailabilityParameter 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 CheckNameAvailabilityParameter")); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CheckNameAvailabilityResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..50c88106c62f8 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.CheckNameAvailabilityResultInner + * object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Cluster.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Cluster.java new file mode 100644 index 0000000000000..b7a5101c57ec2 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Cluster.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterInner; +import java.util.Map; + +/** An immutable client-side representation of Cluster. */ +public interface Cluster { + /** + * 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 the cluster SKU. + * + * @return the sku value. + */ + ClusterSku sku(); + + /** + * Gets the createdAt property: The UTC time when the Event Hubs Cluster was created. + * + * @return the createdAt value. + */ + String createdAt(); + + /** + * Gets the updatedAt property: The UTC time when the Event Hubs Cluster was last updated. + * + * @return the updatedAt value. + */ + String updatedAt(); + + /** + * Gets the metricId property: The metric ID of the cluster resource. Provided by the service and not modifiable by + * the user. + * + * @return the metricId value. + */ + String metricId(); + + /** + * Gets the status property: Status of the Cluster resource. + * + * @return the status value. + */ + String status(); + + /** + * 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.eventhubs.generated.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Cluster 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 Cluster 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 Cluster 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + /** The stage of the Cluster 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 Cluster definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of the cluster SKU.. + * + * @param sku Properties of the cluster SKU. + * @return the next definition stage. + */ + WithCreate withSku(ClusterSku sku); + } + } + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** The template for Cluster update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + /** The Cluster update stages. */ + interface UpdateStages { + /** The stage of the Cluster 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 Cluster update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of the cluster SKU.. + * + * @param sku Properties of the cluster SKU. + * @return the next definition stage. + */ + Update withSku(ClusterSku sku); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterListResult.java new file mode 100644 index 0000000000000..715d0154376fd --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List Event Hubs Clusters operation. */ +@Fluent +public final class ClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterListResult.class); + + /* + * The Event Hubs Clusters present in the List Event Hubs operation + * results. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Empty unless the value parameter + * contains an incomplete list of Event Hubs Clusters. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The Event Hubs Clusters present in the List Event Hubs operation results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Event Hubs Clusters present in the List Event Hubs operation results. + * + * @param value the value value to set. + * @return the ClusterListResult object itself. + */ + public ClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Empty unless the value parameter contains an + * incomplete list of Event Hubs Clusters. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Empty unless the value parameter contains an + * incomplete list of Event Hubs Clusters. + * + * @param nextLink the nextLink value to set. + * @return the ClusterListResult object itself. + */ + public ClusterListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterQuotaConfigurationProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterQuotaConfigurationProperties.java new file mode 100644 index 0000000000000..405a8986d12ce --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterQuotaConfigurationProperties.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; +import java.util.Map; + +/** An immutable client-side representation of ClusterQuotaConfigurationProperties. */ +public interface ClusterQuotaConfigurationProperties { + /** + * Gets the settings property: All possible Cluster settings - a collection of key/value paired settings which apply + * to quotas and configurations imposed on the cluster. + * + * @return the settings value. + */ + Map settings(); + + /** + * Gets the inner + * com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner object. + * + * @return the inner object. + */ + ClusterQuotaConfigurationPropertiesInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterSku.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterSku.java new file mode 100644 index 0000000000000..49401e328b382 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterSku.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.eventhubs.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 parameters particular to a cluster instance. */ +@Fluent +public final class ClusterSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterSku.class); + + /* + * Name of this SKU. + */ + @JsonProperty(value = "name", required = true) + private ClusterSkuName name; + + /* + * The quantity of Event Hubs Cluster Capacity Units contained in this + * cluster. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: Name of this SKU. + * + * @return the name value. + */ + public ClusterSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of this SKU. + * + * @param name the name value to set. + * @return the ClusterSku object itself. + */ + public ClusterSku withName(ClusterSkuName name) { + this.name = name; + return this; + } + + /** + * Get the capacity property: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. + * + * @param capacity the capacity value to set. + * @return the ClusterSku object itself. + */ + public ClusterSku 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 ClusterSku")); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterSkuName.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterSkuName.java new file mode 100644 index 0000000000000..f18d1fc49e4f0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ClusterSkuName.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.eventhubs.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterSkuName. */ +public final class ClusterSkuName extends ExpandableStringEnum { + /** Static value Dedicated for ClusterSkuName. */ + public static final ClusterSkuName DEDICATED = fromString("Dedicated"); + + /** + * Creates or finds a ClusterSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterSkuName. + */ + @JsonCreator + public static ClusterSkuName fromString(String name) { + return fromString(name, ClusterSkuName.class); + } + + /** @return known ClusterSkuName values. */ + public static Collection values() { + return values(ClusterSkuName.class); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Clusters.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Clusters.java new file mode 100644 index 0000000000000..8f54ab5c38466 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Clusters.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.eventhubs.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 Clusters. */ +public interface Clusters { + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @throws com.azure.core.management.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 Available Clusters operation. + */ + AvailableClustersList listAvailableClusterRegion(); + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * + * @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 Available Clusters operation. + */ + Response listAvailableClusterRegionWithResponse(Context context); + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the available Event Hubs Clusters within an ARM 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 response of the List Event Hubs Clusters operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resource description of the specified Event Hubs Cluster. + */ + Cluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 resource description of the specified Event Hubs Cluster. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 clusterName, Context context); + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Namespace IDs operation. + */ + EHNamespaceIdListResult listNamespaces(String resourceGroupName, String clusterName); + + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 Namespace IDs operation. + */ + Response listNamespacesWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @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 the resource description of the specified Event Hubs Cluster. + */ + Cluster getById(String id); + + /** + * Gets the resource description of the specified Event Hubs Cluster. + * + * @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 resource description of the specified Event Hubs Cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * + * @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 Event Hubs Cluster. This operation is idempotent. + * + * @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 Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Configurations.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Configurations.java new file mode 100644 index 0000000000000..a6d28487caa48 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Configurations.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.eventhubs.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; + +/** Resource collection API of Configurations. */ +public interface Configurations { + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + ClusterQuotaConfigurationProperties patch( + String resourceGroupName, String clusterName, ClusterQuotaConfigurationPropertiesInner parameters); + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings + * not specified in the request body unmodified. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating an Event Hubs Cluster 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 contains all settings for the cluster. + */ + Response patchWithResponse( + String resourceGroupName, + String clusterName, + ClusterQuotaConfigurationPropertiesInner parameters, + Context context); + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + ClusterQuotaConfigurationProperties get(String resourceGroupName, String clusterName); + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @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 Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings + * imposed on the cluster. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConnectionState.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConnectionState.java new file mode 100644 index 0000000000000..f1a6c0d1d1768 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroup.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroup.java new file mode 100644 index 0000000000000..12da4984e9c5c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroup.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ConsumerGroupInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ConsumerGroup. */ +public interface ConsumerGroup { + /** + * 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 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 userMetadata property: User Metadata is a placeholder to store user-defined string data with maximum + * length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information + * also user-defined configuration settings can be stored. + * + * @return the userMetadata value. + */ + String userMetadata(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.ConsumerGroupInner object. + * + * @return the inner object. + */ + ConsumerGroupInner innerModel(); + + /** The entirety of the ConsumerGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ConsumerGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the ConsumerGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ConsumerGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName, eventHubName. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @return the next definition stage. + */ + WithCreate withExistingEventhub(String resourceGroupName, String namespaceName, String eventHubName); + } + /** + * The stage of the ConsumerGroup 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.WithUserMetadata { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConsumerGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConsumerGroup create(Context context); + } + /** The stage of the ConsumerGroup definition allowing to specify userMetadata. */ + interface WithUserMetadata { + /** + * Specifies the userMetadata property: User Metadata is a placeholder to store user-defined string data + * with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their + * contact information also user-defined configuration settings can be stored.. + * + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length + * 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact + * information also user-defined configuration settings can be stored. + * @return the next definition stage. + */ + WithCreate withUserMetadata(String userMetadata); + } + } + /** + * Begins update for the ConsumerGroup resource. + * + * @return the stage of resource update. + */ + ConsumerGroup.Update update(); + + /** The template for ConsumerGroup update. */ + interface Update extends UpdateStages.WithUserMetadata { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConsumerGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConsumerGroup apply(Context context); + } + /** The ConsumerGroup update stages. */ + interface UpdateStages { + /** The stage of the ConsumerGroup update allowing to specify userMetadata. */ + interface WithUserMetadata { + /** + * Specifies the userMetadata property: User Metadata is a placeholder to store user-defined string data + * with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their + * contact information also user-defined configuration settings can be stored.. + * + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length + * 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact + * information also user-defined configuration settings can be stored. + * @return the next definition stage. + */ + Update withUserMetadata(String userMetadata); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConsumerGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConsumerGroup refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroupListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroupListResult.java new file mode 100644 index 0000000000000..4bcf0ab51a22e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroupListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ConsumerGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result to the List Consumer Group operation. */ +@Fluent +public final class ConsumerGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupListResult.class); + + /* + * Result of the List Consumer Group operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of Consumer Group + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List Consumer Group operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Consumer Group operation. + * + * @param value the value value to set. + * @return the ConsumerGroupListResult object itself. + */ + public ConsumerGroupListResult 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 + * Consumer Group. + * + * @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 + * Consumer Group. + * + * @param nextLink the nextLink value to set. + * @return the ConsumerGroupListResult object itself. + */ + public ConsumerGroupListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroups.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroups.java new file mode 100644 index 0000000000000..13fb334669271 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroups.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.eventhubs.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 ConsumerGroups. */ +public interface ConsumerGroups { + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName); + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 eventHubName, String consumerGroupName, Context context); + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + ConsumerGroup get(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param consumerGroupName The consumer group 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 consumer group. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, Context context); + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + PagedIterable listByEventHub(String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the + * Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 consumer groups in a Namespace. + */ + PagedIterable listByEventHub( + String resourceGroupName, + String namespaceName, + String eventHubName, + Integer skip, + Integer top, + Context context); + + /** + * Gets a description for the specified consumer 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. + * @return a description for the specified consumer group. + */ + ConsumerGroup getById(String id); + + /** + * Gets a description for the specified consumer 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 a description for the specified consumer group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a consumer group from the specified Event Hub 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 consumer group from the specified Event Hub 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 ConsumerGroup resource. + * + * @param name resource name. + * @return the first stage of the new ConsumerGroup definition. + */ + ConsumerGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/DefaultAction.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/DefaultAction.java new file mode 100644 index 0000000000000..98ff6afa0bc69 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Destination.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Destination.java new file mode 100644 index 0000000000000..231ffd423aef9 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Destination.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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; + +/** Capture storage details for capture description. */ +@JsonFlatten +@Fluent +public class Destination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Destination.class); + + /* + * Name for capture destination + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource id of the storage account to be used to create the blobs + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Blob container Name + */ + @JsonProperty(value = "properties.blobContainer") + private String blobContainer; + + /* + * Blob naming convention for archive, e.g. + * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. + * Here all the parameters (Namespace,EventHub .. etc) are mandatory + * irrespective of order + */ + @JsonProperty(value = "properties.archiveNameFormat") + private String archiveNameFormat; + + /** + * Get the name property: Name for capture destination. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name for capture destination. + * + * @param name the name value to set. + * @return the Destination object itself. + */ + public Destination withName(String name) { + this.name = name; + return this; + } + + /** + * Get the storageAccountResourceId property: Resource id of the storage account to be used to create the blobs. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Resource id of the storage account to be used to create the blobs. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the Destination object itself. + */ + public Destination withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the blobContainer property: Blob container Name. + * + * @return the blobContainer value. + */ + public String blobContainer() { + return this.blobContainer; + } + + /** + * Set the blobContainer property: Blob container Name. + * + * @param blobContainer the blobContainer value to set. + * @return the Destination object itself. + */ + public Destination withBlobContainer(String blobContainer) { + this.blobContainer = blobContainer; + return this; + } + + /** + * Get the archiveNameFormat property: Blob naming convention for archive, e.g. + * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters + * (Namespace,EventHub .. etc) are mandatory irrespective of order. + * + * @return the archiveNameFormat value. + */ + public String archiveNameFormat() { + return this.archiveNameFormat; + } + + /** + * Set the archiveNameFormat property: Blob naming convention for archive, e.g. + * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters + * (Namespace,EventHub .. etc) are mandatory irrespective of order. + * + * @param archiveNameFormat the archiveNameFormat value to set. + * @return the Destination object itself. + */ + public Destination withArchiveNameFormat(String archiveNameFormat) { + this.archiveNameFormat = archiveNameFormat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/DisasterRecoveryConfigs.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/DisasterRecoveryConfigs.java new file mode 100644 index 0000000000000..60948f23f6baa --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/DisasterRecoveryConfigs.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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 { + /** + * Gets a list of 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 a list of authorization rules for a Namespace. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias); + + /** + * Gets a list of 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 a list of authorization rules for a Namespace. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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); + + /** + * 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 Alias 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 Result of the CheckNameAvailability operation. + */ + CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 Alias 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 Result of the CheckNameAvailability operation. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter 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 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, 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespace.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespace.java new file mode 100644 index 0000000000000..2cebd73e788ea --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespace.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of EHNamespace. */ +public interface EHNamespace { + /** + * 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 resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + Identity identity(); + + /** + * 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 clusterArmId property: Cluster ARM ID of the Namespace. + * + * @return the clusterArmId value. + */ + String clusterArmId(); + + /** + * Gets the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + String metricId(); + + /** + * Gets the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub + * namespace. + * + * @return the isAutoInflateEnabled value. + */ + Boolean isAutoInflateEnabled(); + + /** + * Gets the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is enabled, value + * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * + * @return the maximumThroughputUnits value. + */ + Integer maximumThroughputUnits(); + + /** + * Gets the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub namespace. + * + * @return the kafkaEnabled value. + */ + Boolean kafkaEnabled(); + + /** + * Gets the zoneRedundant property: Enabling this property creates a Standard Event Hubs 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 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.eventhubs.generated.fluent.models.EHNamespaceInner object. + * + * @return the inner object. + */ + EHNamespaceInner innerModel(); + + /** The entirety of the EHNamespace definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The EHNamespace definition stages. */ + interface DefinitionStages { + /** The first stage of the EHNamespace definition. */ + interface Blank extends WithLocation { + } + /** The stage of the EHNamespace 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 EHNamespace 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 EHNamespace 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.WithClusterArmId, + DefinitionStages.WithIsAutoInflateEnabled, + DefinitionStages.WithMaximumThroughputUnits, + DefinitionStages.WithKafkaEnabled, + DefinitionStages.WithZoneRedundant, + DefinitionStages.WithEncryption { + /** + * Executes the create request. + * + * @return the created resource. + */ + EHNamespace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EHNamespace create(Context context); + } + /** The stage of the EHNamespace 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 EHNamespace definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of sku resource. + * + * @param sku Properties of sku resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the EHNamespace 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 EHNamespace definition allowing to specify clusterArmId. */ + interface WithClusterArmId { + /** + * Specifies the clusterArmId property: Cluster ARM ID of the Namespace.. + * + * @param clusterArmId Cluster ARM ID of the Namespace. + * @return the next definition stage. + */ + WithCreate withClusterArmId(String clusterArmId); + } + /** The stage of the EHNamespace definition allowing to specify isAutoInflateEnabled. */ + interface WithIsAutoInflateEnabled { + /** + * Specifies the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for + * eventhub namespace.. + * + * @param isAutoInflateEnabled Value that indicates whether AutoInflate is enabled for eventhub namespace. + * @return the next definition stage. + */ + WithCreate withIsAutoInflateEnabled(Boolean isAutoInflateEnabled); + } + /** The stage of the EHNamespace definition allowing to specify maximumThroughputUnits. */ + interface WithMaximumThroughputUnits { + /** + * Specifies the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is + * enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * + * @param maximumThroughputUnits Upper limit of throughput units when AutoInflate is enabled, value should + * be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * @return the next definition stage. + */ + WithCreate withMaximumThroughputUnits(Integer maximumThroughputUnits); + } + /** The stage of the EHNamespace definition allowing to specify kafkaEnabled. */ + interface WithKafkaEnabled { + /** + * Specifies the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub + * namespace.. + * + * @param kafkaEnabled Value that indicates whether Kafka is enabled for eventhub namespace. + * @return the next definition stage. + */ + WithCreate withKafkaEnabled(Boolean kafkaEnabled); + } + /** The stage of the EHNamespace definition allowing to specify zoneRedundant. */ + interface WithZoneRedundant { + /** + * Specifies the zoneRedundant property: Enabling this property creates a Standard Event Hubs Namespace in + * regions supported availability zones.. + * + * @param zoneRedundant Enabling this property creates a Standard Event Hubs Namespace in regions supported + * availability zones. + * @return the next definition stage. + */ + WithCreate withZoneRedundant(Boolean zoneRedundant); + } + /** The stage of the EHNamespace 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); + } + } + /** + * Begins update for the EHNamespace resource. + * + * @return the stage of resource update. + */ + EHNamespace.Update update(); + + /** The template for EHNamespace update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithClusterArmId, + UpdateStages.WithIsAutoInflateEnabled, + UpdateStages.WithMaximumThroughputUnits, + UpdateStages.WithKafkaEnabled, + UpdateStages.WithZoneRedundant, + UpdateStages.WithEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EHNamespace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EHNamespace apply(Context context); + } + /** The EHNamespace update stages. */ + interface UpdateStages { + /** The stage of the EHNamespace 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 EHNamespace update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of sku resource. + * + * @param sku Properties of sku resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the EHNamespace 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 EHNamespace update allowing to specify clusterArmId. */ + interface WithClusterArmId { + /** + * Specifies the clusterArmId property: Cluster ARM ID of the Namespace.. + * + * @param clusterArmId Cluster ARM ID of the Namespace. + * @return the next definition stage. + */ + Update withClusterArmId(String clusterArmId); + } + /** The stage of the EHNamespace update allowing to specify isAutoInflateEnabled. */ + interface WithIsAutoInflateEnabled { + /** + * Specifies the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for + * eventhub namespace.. + * + * @param isAutoInflateEnabled Value that indicates whether AutoInflate is enabled for eventhub namespace. + * @return the next definition stage. + */ + Update withIsAutoInflateEnabled(Boolean isAutoInflateEnabled); + } + /** The stage of the EHNamespace update allowing to specify maximumThroughputUnits. */ + interface WithMaximumThroughputUnits { + /** + * Specifies the maximumThroughputUnits property: Upper limit of throughput units when AutoInflate is + * enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * + * @param maximumThroughputUnits Upper limit of throughput units when AutoInflate is enabled, value should + * be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * @return the next definition stage. + */ + Update withMaximumThroughputUnits(Integer maximumThroughputUnits); + } + /** The stage of the EHNamespace update allowing to specify kafkaEnabled. */ + interface WithKafkaEnabled { + /** + * Specifies the kafkaEnabled property: Value that indicates whether Kafka is enabled for eventhub + * namespace.. + * + * @param kafkaEnabled Value that indicates whether Kafka is enabled for eventhub namespace. + * @return the next definition stage. + */ + Update withKafkaEnabled(Boolean kafkaEnabled); + } + /** The stage of the EHNamespace update allowing to specify zoneRedundant. */ + interface WithZoneRedundant { + /** + * Specifies the zoneRedundant property: Enabling this property creates a Standard Event Hubs Namespace in + * regions supported availability zones.. + * + * @param zoneRedundant Enabling this property creates a Standard Event Hubs Namespace in regions supported + * availability zones. + * @return the next definition stage. + */ + Update withZoneRedundant(Boolean zoneRedundant); + } + /** The stage of the EHNamespace 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EHNamespace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EHNamespace refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceIdContainer.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceIdContainer.java new file mode 100644 index 0000000000000..79cd3a2fc8c84 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceIdContainer.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.eventhubs.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 full ARM ID of an Event Hubs Namespace. */ +@Fluent +public final class EHNamespaceIdContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceIdContainer.class); + + /* + * id parameter + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: id parameter. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: id parameter. + * + * @param id the id value to set. + * @return the EHNamespaceIdContainer object itself. + */ + public EHNamespaceIdContainer 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceIdListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceIdListResult.java new file mode 100644 index 0000000000000..4a9d9af148c97 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceIdListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceIdListResultInner; +import java.util.List; + +/** An immutable client-side representation of EHNamespaceIdListResult. */ +public interface EHNamespaceIdListResult { + /** + * Gets the value property: Result of the List Namespace IDs operation. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceIdListResultInner object. + * + * @return the inner object. + */ + EHNamespaceIdListResultInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceListResult.java new file mode 100644 index 0000000000000..8c33d693e6f85 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespaceListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +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 EHNamespaceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceListResult.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 EHNamespaceListResult object itself. + */ + public EHNamespaceListResult 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 EHNamespaceListResult object itself. + */ + public EHNamespaceListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EncodingCaptureDescription.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EncodingCaptureDescription.java new file mode 100644 index 0000000000000..544436bd1c262 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EncodingCaptureDescription.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.eventhubs.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for EncodingCaptureDescription. */ +public enum EncodingCaptureDescription { + /** Enum value Avro. */ + AVRO("Avro"), + + /** Enum value AvroDeflate. */ + AVRO_DEFLATE("AvroDeflate"); + + /** The actual serialized value for a EncodingCaptureDescription instance. */ + private final String value; + + EncodingCaptureDescription(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncodingCaptureDescription instance. + * + * @param value the serialized value to parse. + * @return the parsed EncodingCaptureDescription object, or null if unable to parse. + */ + @JsonCreator + public static EncodingCaptureDescription fromString(String value) { + EncodingCaptureDescription[] items = EncodingCaptureDescription.values(); + for (EncodingCaptureDescription item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Encryption.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Encryption.java new file mode 100644 index 0000000000000..2e9d8ea6af96e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Encryption.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.eventhubs.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; + + /** + * 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; + } + + /** + * 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EndPointProvisioningState.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EndPointProvisioningState.java new file mode 100644 index 0000000000000..2c2ba5c6bfcc6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EntityStatus.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EntityStatus.java new file mode 100644 index 0000000000000..f2ed0703ec9d4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EventHubListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EventHubListResult.java new file mode 100644 index 0000000000000..bf50cd5ab0484 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EventHubListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the List EventHubs operation. */ +@Fluent +public final class EventHubListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventHubListResult.class); + + /* + * Result of the List EventHubs operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of EventHubs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List EventHubs operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List EventHubs operation. + * + * @param value the value value to set. + * @return the EventHubListResult object itself. + */ + public EventHubListResult 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 + * EventHubs. + * + * @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 + * EventHubs. + * + * @param nextLink the nextLink value to set. + * @return the EventHubListResult object itself. + */ + public EventHubListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EventHubs.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EventHubs.java new file mode 100644 index 0000000000000..88e61962dab93 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EventHubs.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.AuthorizationRuleInner; + +/** Resource collection API of EventHubs. */ +public interface EventHubs { + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 an Event Hub. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String eventHubName, Context context); + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a List or Get AuthorizationRule operation. + */ + AuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters); + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule + * will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @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 a List or Get AuthorizationRule operation. + */ + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context); + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 AuthorizationRule for an Event Hub by rule name. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context); + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, String authorizationRuleName); + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, + String authorizationRuleName, + Context context); + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + AccessKeys listKeys( + String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 ACS and SAS connection strings for the Event Hub. + */ + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + Context context); + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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/EventHub Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @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/EventHub Connection String. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Gets all the Event Hubs 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 Event Hubs in a Namespace. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets all the Event Hubs 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 Event Hubs in a Namespace. + */ + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName); + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 eventHubName, Context context); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + Eventhub get(String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param eventHubName The Event Hub 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 Event Hubs description for the specified Event Hub. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, Context context); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @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 Event Hubs description for the specified Event Hub. + */ + Eventhub getById(String id); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @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 Event Hubs description for the specified Event Hub. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Event Hub 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 an Event Hub 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 Eventhub resource. + * + * @param name resource name. + * @return the first stage of the new Eventhub definition. + */ + Eventhub.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Eventhub.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Eventhub.java new file mode 100644 index 0000000000000..fae3e235a7d6d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Eventhub.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Eventhub. */ +public interface Eventhub { + /** + * 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 partitionIds property: Current number of shards on the Event Hub. + * + * @return the partitionIds value. + */ + List partitionIds(); + + /** + * Gets the createdAt property: Exact time the Event Hub 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 messageRetentionInDays property: Number of days to retain the events for this Event Hub, value should be + * 1 to 7 days. + * + * @return the messageRetentionInDays value. + */ + Long messageRetentionInDays(); + + /** + * Gets the partitionCount property: Number of partitions created for the Event Hub, allowed values are from 1 to 32 + * partitions. + * + * @return the partitionCount value. + */ + Long partitionCount(); + + /** + * Gets the status property: Enumerates the possible values for the status of the Event Hub. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the captureDescription property: Properties of capture description. + * + * @return the captureDescription value. + */ + CaptureDescription captureDescription(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.EventhubInner object. + * + * @return the inner object. + */ + EventhubInner innerModel(); + + /** The entirety of the Eventhub definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Eventhub definition stages. */ + interface DefinitionStages { + /** The first stage of the Eventhub definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Eventhub 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 Eventhub 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.WithMessageRetentionInDays, + DefinitionStages.WithPartitionCount, + DefinitionStages.WithStatus, + DefinitionStages.WithCaptureDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + Eventhub create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Eventhub create(Context context); + } + /** The stage of the Eventhub definition allowing to specify messageRetentionInDays. */ + interface WithMessageRetentionInDays { + /** + * Specifies the messageRetentionInDays property: Number of days to retain the events for this Event Hub, + * value should be 1 to 7 days. + * + * @param messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 + * to 7 days. + * @return the next definition stage. + */ + WithCreate withMessageRetentionInDays(Long messageRetentionInDays); + } + /** The stage of the Eventhub definition allowing to specify partitionCount. */ + interface WithPartitionCount { + /** + * Specifies the partitionCount property: Number of partitions created for the Event Hub, allowed values are + * from 1 to 32 partitions.. + * + * @param partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 + * partitions. + * @return the next definition stage. + */ + WithCreate withPartitionCount(Long partitionCount); + } + /** The stage of the Eventhub definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of the Event Hub.. + * + * @param status Enumerates the possible values for the status of the Event Hub. + * @return the next definition stage. + */ + WithCreate withStatus(EntityStatus status); + } + /** The stage of the Eventhub definition allowing to specify captureDescription. */ + interface WithCaptureDescription { + /** + * Specifies the captureDescription property: Properties of capture description. + * + * @param captureDescription Properties of capture description. + * @return the next definition stage. + */ + WithCreate withCaptureDescription(CaptureDescription captureDescription); + } + } + /** + * Begins update for the Eventhub resource. + * + * @return the stage of resource update. + */ + Eventhub.Update update(); + + /** The template for Eventhub update. */ + interface Update + extends UpdateStages.WithMessageRetentionInDays, + UpdateStages.WithPartitionCount, + UpdateStages.WithStatus, + UpdateStages.WithCaptureDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Eventhub apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Eventhub apply(Context context); + } + /** The Eventhub update stages. */ + interface UpdateStages { + /** The stage of the Eventhub update allowing to specify messageRetentionInDays. */ + interface WithMessageRetentionInDays { + /** + * Specifies the messageRetentionInDays property: Number of days to retain the events for this Event Hub, + * value should be 1 to 7 days. + * + * @param messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 + * to 7 days. + * @return the next definition stage. + */ + Update withMessageRetentionInDays(Long messageRetentionInDays); + } + /** The stage of the Eventhub update allowing to specify partitionCount. */ + interface WithPartitionCount { + /** + * Specifies the partitionCount property: Number of partitions created for the Event Hub, allowed values are + * from 1 to 32 partitions.. + * + * @param partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 + * partitions. + * @return the next definition stage. + */ + Update withPartitionCount(Long partitionCount); + } + /** The stage of the Eventhub update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of the Event Hub.. + * + * @param status Enumerates the possible values for the status of the Event Hub. + * @return the next definition stage. + */ + Update withStatus(EntityStatus status); + } + /** The stage of the Eventhub update allowing to specify captureDescription. */ + interface WithCaptureDescription { + /** + * Specifies the captureDescription property: Properties of capture description. + * + * @param captureDescription Properties of capture description. + * @return the next definition stage. + */ + Update withCaptureDescription(CaptureDescription captureDescription); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Eventhub refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Eventhub refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Identity.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Identity.java new file mode 100644 index 0000000000000..e2a172d5e6146 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Identity.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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 Identity 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") + private String principalId; + + /* + * TenantId from the KeyVault + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Enumerates the possible value Identity type, which currently supports + * only 'SystemAssigned' + */ + @JsonProperty(value = "type") + private IdentityType type; + + /** + * Get the principalId property: ObjectId from the KeyVault. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: ObjectId from the KeyVault. + * + * @param principalId the principalId value to set. + * @return the Identity object itself. + */ + public Identity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: TenantId from the KeyVault. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: TenantId from the KeyVault. + * + * @param tenantId the tenantId value to set. + * @return the Identity object itself. + */ + public Identity withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the type property: Enumerates the possible value Identity type, which currently supports only + * 'SystemAssigned'. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: Enumerates the possible value Identity type, which currently supports only + * 'SystemAssigned'. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IdentityType.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IdentityType.java new file mode 100644 index 0000000000000..eefc56ddd43ae --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IdentityType.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.eventhubs.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for IdentityType. */ +public enum IdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a IdentityType instance. */ + private final String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpAction.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpAction.java new file mode 100644 index 0000000000000..20478dd08cffa --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpAction.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.eventhubs.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpAction. */ +public final class IpAction extends ExpandableStringEnum { + /** Static value Accept for IpAction. */ + public static final IpAction ACCEPT = fromString("Accept"); + + /** Static value Reject for IpAction. */ + public static final IpAction REJECT = fromString("Reject"); + + /** + * Creates or finds a IpAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAction. + */ + @JsonCreator + public static IpAction fromString(String name) { + return fromString(name, IpAction.class); + } + + /** @return known IpAction values. */ + public static Collection values() { + return values(IpAction.class); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpFilterRule.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpFilterRule.java new file mode 100644 index 0000000000000..a8b5fc491be9a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpFilterRule.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.eventhubs.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner; + +/** An immutable client-side representation of IpFilterRule. */ +public interface IpFilterRule { + /** + * 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 ipMask property: IP Mask. + * + * @return the ipMask value. + */ + String ipMask(); + + /** + * Gets the action property: The IP Filter Action. + * + * @return the action value. + */ + IpAction action(); + + /** + * Gets the filterName property: IP Filter name. + * + * @return the filterName value. + */ + String filterName(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner object. + * + * @return the inner object. + */ + IpFilterRuleInner innerModel(); + + /** The entirety of the IpFilterRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IpFilterRule definition stages. */ + interface DefinitionStages { + /** The first stage of the IpFilterRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IpFilterRule 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 IpFilterRule 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.WithIpMask, DefinitionStages.WithAction, DefinitionStages.WithFilterName { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpFilterRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpFilterRule create(Context context); + } + /** The stage of the IpFilterRule definition allowing to specify ipMask. */ + interface WithIpMask { + /** + * Specifies the ipMask property: IP Mask. + * + * @param ipMask IP Mask. + * @return the next definition stage. + */ + WithCreate withIpMask(String ipMask); + } + /** The stage of the IpFilterRule definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: The IP Filter Action. + * + * @param action The IP Filter Action. + * @return the next definition stage. + */ + WithCreate withAction(IpAction action); + } + /** The stage of the IpFilterRule definition allowing to specify filterName. */ + interface WithFilterName { + /** + * Specifies the filterName property: IP Filter name. + * + * @param filterName IP Filter name. + * @return the next definition stage. + */ + WithCreate withFilterName(String filterName); + } + } + /** + * Begins update for the IpFilterRule resource. + * + * @return the stage of resource update. + */ + IpFilterRule.Update update(); + + /** The template for IpFilterRule update. */ + interface Update extends UpdateStages.WithIpMask, UpdateStages.WithAction, UpdateStages.WithFilterName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpFilterRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpFilterRule apply(Context context); + } + /** The IpFilterRule update stages. */ + interface UpdateStages { + /** The stage of the IpFilterRule update allowing to specify ipMask. */ + interface WithIpMask { + /** + * Specifies the ipMask property: IP Mask. + * + * @param ipMask IP Mask. + * @return the next definition stage. + */ + Update withIpMask(String ipMask); + } + /** The stage of the IpFilterRule update allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: The IP Filter Action. + * + * @param action The IP Filter Action. + * @return the next definition stage. + */ + Update withAction(IpAction action); + } + /** The stage of the IpFilterRule update allowing to specify filterName. */ + interface WithFilterName { + /** + * Specifies the filterName property: IP Filter name. + * + * @param filterName IP Filter name. + * @return the next definition stage. + */ + Update withFilterName(String filterName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpFilterRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpFilterRule refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpFilterRuleListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpFilterRuleListResult.java new file mode 100644 index 0000000000000..aa60eb334b540 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/IpFilterRuleListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.IpFilterRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List namespace operation. */ +@Fluent +public final class IpFilterRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpFilterRuleListResult.class); + + /* + * Result of the List IpFilter Rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains an + * incomplete list of IpFilter Rules + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List IpFilter Rules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List IpFilter Rules operation. + * + * @param value the value value to set. + * @return the IpFilterRuleListResult object itself. + */ + public IpFilterRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains an incomplete list of + * IpFilter 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 an incomplete list of + * IpFilter Rules. + * + * @param nextLink the nextLink value to set. + * @return the IpFilterRuleListResult object itself. + */ + public IpFilterRuleListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeySource.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeySource.java new file mode 100644 index 0000000000000..1f175f6f73b1a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyType.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyType.java new file mode 100644 index 0000000000000..fb5465b01e0bc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyVaultProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyVaultProperties.java new file mode 100644 index 0000000000000..6eadb0f2d0fd0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyVaultProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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; + + /* + * Key Version + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /** + * 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: Key Version. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: Key Version. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegions.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegions.java new file mode 100644 index 0000000000000..7489b4f2d3e3d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.generated.fluent.models.MessagingRegionsInner; +import java.util.Map; + +/** An immutable client-side representation of MessagingRegions. */ +public interface MessagingRegions { + /** + * 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 properties property: Properties of Messaging Region. + * + * @return the properties value. + */ + MessagingRegionsProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.MessagingRegionsInner object. + * + * @return the inner object. + */ + MessagingRegionsInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegionsListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegionsListResult.java new file mode 100644 index 0000000000000..b83ccc605773c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegionsListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.MessagingRegionsInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List MessagingRegions operation. */ +@Fluent +public final class MessagingRegionsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MessagingRegionsListResult.class); + + /* + * Result of the List MessagingRegions type. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of MessagingRegions. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Result of the List MessagingRegions type. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List MessagingRegions type. + * + * @param value the value value to set. + * @return the MessagingRegionsListResult object itself. + */ + public MessagingRegionsListResult 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 + * MessagingRegions. + * + * @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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegionsProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegionsProperties.java new file mode 100644 index 0000000000000..c96f2090bff9e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/MessagingRegionsProperties.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.eventhubs.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; + +/** Properties of Messaging Region. */ +@Immutable +public final class MessagingRegionsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MessagingRegionsProperties.class); + + /* + * Region code + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Full name of the region + */ + @JsonProperty(value = "fullName", access = JsonProperty.Access.WRITE_ONLY) + private String fullName; + + /** + * Get the code property: Region code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the fullName property: Full name of the region. + * + * @return the fullName value. + */ + public String fullName() { + return this.fullName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NWRuleSetIpRules.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NWRuleSetIpRules.java new file mode 100644 index 0000000000000..fd0ace0c76a66 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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 response from the List namespace operation. */ +@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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NWRuleSetVirtualNetworkRules.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NWRuleSetVirtualNetworkRules.java new file mode 100644 index 0000000000000..a84e3d4908661 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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 response from the List namespace operation. */ +@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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Namespaces.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Namespaces.java new file mode 100644 index 0000000000000..64f1d4698434e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Namespaces.java @@ -0,0 +1,705 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.NetworkRuleSetInner; + +/** Resource collection API of Namespaces. */ +public interface Namespaces { + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of IP Filter rules for a Namespace. + */ + PagedIterable listIpFilterRules(String resourceGroupName, String namespaceName); + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param 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 list of IP Filter rules for a Namespace. + */ + PagedIterable listIpFilterRules(String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName); + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 deleteIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context); + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 IpFilterRule for a Namespace by rule name. + */ + IpFilterRule getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName); + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param ipFilterRuleName The IP Filter Rule name. + * @param 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 IpFilterRule for a Namespace by rule name. + */ + Response getIpFilterRuleWithResponse( + String resourceGroupName, String namespaceName, String ipFilterRuleName, Context context); + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + PagedIterable list(); + + /** + * Lists all the available Namespaces within a 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 the response of the List Namespace operation. + */ + PagedIterable list(Context context); + + /** + * Lists 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 response of the List Namespace operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists 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 response of the List Namespace operation. + */ + 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 the description of 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 the description of the specified namespace. + */ + EHNamespace getByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Gets the description of 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 the description of the specified namespace. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 list of VirtualNetwork rules for a Namespace. + */ + PagedIterable listVirtualNetworkRules(String resourceGroupName, String namespaceName); + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @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 list of VirtualNetwork rules for a Namespace. + */ + PagedIterable listVirtualNetworkRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName); + + /** + * Deletes an VirtualNetworkRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param 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 deleteVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, Context context); + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + VirtualNetworkRule getVirtualNetworkRule( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName); + + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param virtualNetworkRuleName The Virtual Network 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 VirtualNetworkRule for a Namespace by rule name. + */ + Response getVirtualNetworkRuleWithResponse( + String resourceGroupName, String namespaceName, String virtualNetworkRuleName, 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 topic 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 topic 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 a list of 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 a list of authorization rules for a Namespace. + */ + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + + /** + * Gets a list of 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 a list of authorization rules for a Namespace. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes an AuthorizationRule 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an AuthorizationRule 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 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 AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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 specified 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 required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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/EventHub Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Regenerates the primary or secondary connection strings for the specified 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 required to regenerate the connection string. + * @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/EventHub 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 the Result of the CheckNameAvailability operation. + */ + CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailabilityParameter 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 the Result of the CheckNameAvailability operation. + */ + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityParameter parameters, Context context); + + /** + * Gets the description of 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 the description of the specified namespace. + */ + EHNamespace getById(String id); + + /** + * Gets the description of 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 the description of the specified namespace. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Gets an IpFilterRule 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 IpFilterRule for a Namespace by rule name. + */ + IpFilterRule getIpFilterRuleById(String id); + + /** + * Gets an IpFilterRule 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 IpFilterRule for a Namespace by rule name. + */ + Response getIpFilterRuleByIdWithResponse(String id, Context context); + + /** + * Gets an VirtualNetworkRule 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 VirtualNetworkRule for a Namespace by rule name. + */ + VirtualNetworkRule getVirtualNetworkRuleById(String id); + + /** + * Gets an VirtualNetworkRule 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 VirtualNetworkRule for a Namespace by rule name. + */ + Response getVirtualNetworkRuleByIdWithResponse(String id, Context context); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule for a Namespace by rule name. + */ + AuthorizationRule getAuthorizationRuleById(String id); + + /** + * Gets an AuthorizationRule 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 AuthorizationRule 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 an IpFilterRule for a 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 deleteIpFilterRuleById(String id); + + /** + * Deletes an IpFilterRule for a 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 the response. + */ + Response deleteIpFilterRuleByIdWithResponse(String id, Context context); + + /** + * Deletes an VirtualNetworkRule for a 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 deleteVirtualNetworkRuleById(String id); + + /** + * Deletes an VirtualNetworkRule for a 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 the response. + */ + Response deleteVirtualNetworkRuleByIdWithResponse(String id, Context context); + + /** + * Deletes an AuthorizationRule for a 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 deleteAuthorizationRuleById(String id); + + /** + * Deletes an AuthorizationRule for a 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 the response. + */ + Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EHNamespace resource. + * + * @param name resource name. + * @return the first stage of the new EHNamespace definition. + */ + EHNamespace.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new IpFilterRule resource. + * + * @param name resource name. + * @return the first stage of the new IpFilterRule definition. + */ + IpFilterRule.DefinitionStages.Blank defineIpFilterRule(String name); + + /** + * Begins definition for a new VirtualNetworkRule resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkRule definition. + */ + VirtualNetworkRule.DefinitionStages.Blank defineVirtualNetworkRule(String name); + + /** + * Begins definition for a new AuthorizationRule resource. + * + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + AuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleIpAction.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleIpAction.java new file mode 100644 index 0000000000000..1d14ab2a945e9 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleSet.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..455fd734933fb --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleSet.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.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.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 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 inner com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetInner object. + * + * @return the inner object. + */ + NetworkRuleSetInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Operation.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Operation.java new file mode 100644 index 0000000000000..decf42e61dd11 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/OperationDisplay.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..89356360a7179 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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.EventHub + */ + @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.EventHub. + * + * @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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/OperationListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..f4a539453c759 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.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 Event Hub 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 Event Hub operations supported by the Microsoft.EventHub + * 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 Event Hub operations supported by the Microsoft.EventHub 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Operations.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Operations.java new file mode 100644 index 0000000000000..5cebd0527f560 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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 Event Hub 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 Event Hub operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Event Hub 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 Event Hub operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpoint.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..a37c05fe83316 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnection.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..fed429726f5b3 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnection.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.eventhubs.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.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 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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnectionListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..9b3c4c1affbd3 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnections.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..3590e882c4ea6 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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 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 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 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 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 name. + * + * @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 name. + */ + PrivateEndpointConnection get(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @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 name. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection 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 a description for the specified Private Endpoint Connection name. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a description for the specified Private Endpoint Connection 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 a description for the specified Private Endpoint Connection name. + */ + Response getByIdWithResponse(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); + + /** + * 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkConnectionStatus.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkConnectionStatus.java new file mode 100644 index 0000000000000..b2f4006869099 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResource.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..43140db27feb4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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 private link resource group id. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers") + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @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 private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The private link resource group id. + * + * @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: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @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: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResources.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..f264674e228d9 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResourcesListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResourcesListResult.java new file mode 100644 index 0000000000000..82ce6e45da1c1 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.generated.models; + +import com.azure.resourcemanager.eventhubs.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.eventhubs.generated.fluent.models.PrivateLinkResourcesListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourcesListResultInner innerModel(); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ProvisioningStateDR.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ProvisioningStateDR.java new file mode 100644 index 0000000000000..a75d02d37359d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/RegenerateAccessKeyParameters.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/RegenerateAccessKeyParameters.java new file mode 100644 index 0000000000000..d57776399d7bb --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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 set for KeyType or autogenerated + * 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 set for KeyType or autogenerated 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 set for KeyType or autogenerated 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Regions.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Regions.java new file mode 100644 index 0000000000000..c1ee92c25c242 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Regions.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.eventhubs.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Regions. */ +public interface Regions { + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Regions for a given sku. + */ + PagedIterable listBySku(String sku); + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @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 Regions for a given sku. + */ + PagedIterable listBySku(String sku, Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/RoleDisasterRecovery.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/RoleDisasterRecovery.java new file mode 100644 index 0000000000000..1dd552e076ae5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Sku.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Sku.java new file mode 100644 index 0000000000000..c7c98037b3674 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Sku.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.eventhubs.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 parameters supplied to the create namespace operation. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.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 Event Hubs throughput units, value should be 0 to 20 throughput + * units. + */ + @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 Sku object itself. + */ + public Sku 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 Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: The Event Hubs throughput units, value should be 0 to 20 throughput units. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The Event Hubs throughput units, value should be 0 to 20 throughput units. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku 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 Sku")); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuName.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuName.java new file mode 100644 index 0000000000000..fbddd502f595d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuName.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.eventhubs.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuTier.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuTier.java new file mode 100644 index 0000000000000..d90e6ee40f5e2 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuTier.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.eventhubs.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuTier. */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** @return known SkuTier values. */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Subnet.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Subnet.java new file mode 100644 index 0000000000000..cbf20f2c3050b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Subnet.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.eventhubs.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") + 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() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UnavailableReason.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UnavailableReason.java new file mode 100644 index 0000000000000..ce9268d410649 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/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.eventhubs.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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/VirtualNetworkRule.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..d5e163eca13af --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/VirtualNetworkRule.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.eventhubs.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner; + +/** An immutable client-side representation of VirtualNetworkRule. */ +public interface VirtualNetworkRule { + /** + * 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 virtualNetworkSubnetId property: ARM ID of Virtual Network Subnet. + * + * @return the virtualNetworkSubnetId value. + */ + String virtualNetworkSubnetId(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner object. + * + * @return the inner object. + */ + VirtualNetworkRuleInner innerModel(); + + /** The entirety of the VirtualNetworkRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualNetworkRule definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualNetworkRule 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 VirtualNetworkRule 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.WithVirtualNetworkSubnetId { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkRule create(Context context); + } + /** The stage of the VirtualNetworkRule definition allowing to specify virtualNetworkSubnetId. */ + interface WithVirtualNetworkSubnetId { + /** + * Specifies the virtualNetworkSubnetId property: ARM ID of Virtual Network Subnet. + * + * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkSubnetId(String virtualNetworkSubnetId); + } + } + /** + * Begins update for the VirtualNetworkRule resource. + * + * @return the stage of resource update. + */ + VirtualNetworkRule.Update update(); + + /** The template for VirtualNetworkRule update. */ + interface Update extends UpdateStages.WithVirtualNetworkSubnetId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkRule apply(Context context); + } + /** The VirtualNetworkRule update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkRule update allowing to specify virtualNetworkSubnetId. */ + interface WithVirtualNetworkSubnetId { + /** + * Specifies the virtualNetworkSubnetId property: ARM ID of Virtual Network Subnet. + * + * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet. + * @return the next definition stage. + */ + Update withVirtualNetworkSubnetId(String virtualNetworkSubnetId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkRule refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/VirtualNetworkRuleListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/VirtualNetworkRuleListResult.java new file mode 100644 index 0000000000000..48284d5c736b5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/VirtualNetworkRuleListResult.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.eventhubs.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.VirtualNetworkRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List namespace operation. */ +@Fluent +public final class VirtualNetworkRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRuleListResult.class); + + /* + * Result of the List VirtualNetwork Rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains an + * incomplete list of VirtualNetwork Rules + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List VirtualNetwork Rules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List VirtualNetwork Rules operation. + * + * @param value the value value to set. + * @return the VirtualNetworkRuleListResult object itself. + */ + public VirtualNetworkRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains an incomplete list of + * VirtualNetwork 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 an incomplete list of + * VirtualNetwork Rules. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkRuleListResult object itself. + */ + public VirtualNetworkRuleListResult 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/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/package-info.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/package-info.java new file mode 100644 index 0000000000000..c1d98aaf69572 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/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 data models for EventHubManagementClient. Azure Event Hubs client for managing Event Hubs + * Cluster, IPFilter Rules and VirtualNetworkRules resources. + */ +package com.azure.resourcemanager.eventhubs.generated.models; diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/package-info.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/package-info.java new file mode 100644 index 0000000000000..407df33b9d179 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/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 classes for EventHubManagementClient. Azure Event Hubs client for managing Event Hubs Cluster, + * IPFilter Rules and VirtualNetworkRules resources. + */ +package com.azure.resourcemanager.eventhubs.generated; diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/module-info.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ba081f75f4f4a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-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.eventhubs.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.eventhubs.generated; + exports com.azure.resourcemanager.eventhubs.generated.fluent; + exports com.azure.resourcemanager.eventhubs.generated.fluent.models; + exports com.azure.resourcemanager.eventhubs.generated.models; + + opens com.azure.resourcemanager.eventhubs.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.eventhubs.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/eventhubs/ci.yml b/sdk/eventhubs/ci.yml index 979e361acfd92..a067d8fddc7fa 100644 --- a/sdk/eventhubs/ci.yml +++ b/sdk/eventhubs/ci.yml @@ -52,6 +52,9 @@ extends: - name: azure-messaging-eventhubs-checkpointstore-blob groupId: com.azure safeName: azuremessagingeventhubscheckpointstoreblob + - name: azure-resourcemanager-eventhubs-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagereventhubsgenerated AdditionalModules: - name: azure-messaging-eventhubs-track1-perf groupId: com.azure diff --git a/sdk/eventhubs/pom.xml b/sdk/eventhubs/pom.xml index 3e3ab2a0d2deb..f2e29f898cc52 100644 --- a/sdk/eventhubs/pom.xml +++ b/sdk/eventhubs/pom.xml @@ -57,13 +57,14 @@ true - microsoft-azure-eventhubs - microsoft-azure-eventhubs-eph - microsoft-azure-eventhubs-extensions azure-messaging-eventhubs azure-messaging-eventhubs-checkpointstore-blob azure-messaging-eventhubs-track1-perf azure-messaging-eventhubs-track2-perf + azure-resourcemanager-eventhubs-generated + microsoft-azure-eventhubs + microsoft-azure-eventhubs-eph + microsoft-azure-eventhubs-extensions