diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 69fb428d258eb..54284ab6b262a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -334,6 +334,7 @@ com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;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 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current 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..88694b6864ef3 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-01-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-2021-11. 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..67ab43d68f119 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/README.md @@ -0,0 +1,102 @@ +# 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-2021-11. 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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/SAMPLE.md) + + +## 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/SAMPLE.md b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/SAMPLE.md new file mode 100644 index 0000000000000..2a32464206067 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/SAMPLE.md @@ -0,0 +1,1742 @@ +# Code snippets and samples + + +## Clusters + +- [CreateOrUpdate](#clusters_createorupdate) +- [Delete](#clusters_delete) +- [GetByResourceGroup](#clusters_getbyresourcegroup) +- [List](#clusters_list) +- [ListAvailableClusterRegion](#clusters_listavailableclusterregion) +- [ListByResourceGroup](#clusters_listbyresourcegroup) +- [ListNamespaces](#clusters_listnamespaces) +- [Update](#clusters_update) + +## Configuration + +- [Get](#configuration_get) +- [Patch](#configuration_patch) + +## ConsumerGroups + +- [CreateOrUpdate](#consumergroups_createorupdate) +- [Delete](#consumergroups_delete) +- [Get](#consumergroups_get) +- [ListByEventHub](#consumergroups_listbyeventhub) + +## DisasterRecoveryConfigs + +- [BreakPairing](#disasterrecoveryconfigs_breakpairing) +- [CheckNameAvailability](#disasterrecoveryconfigs_checknameavailability) +- [CreateOrUpdate](#disasterrecoveryconfigs_createorupdate) +- [Delete](#disasterrecoveryconfigs_delete) +- [FailOver](#disasterrecoveryconfigs_failover) +- [Get](#disasterrecoveryconfigs_get) +- [GetAuthorizationRule](#disasterrecoveryconfigs_getauthorizationrule) +- [List](#disasterrecoveryconfigs_list) +- [ListAuthorizationRules](#disasterrecoveryconfigs_listauthorizationrules) +- [ListKeys](#disasterrecoveryconfigs_listkeys) + +## EventHubs + +- [CreateOrUpdate](#eventhubs_createorupdate) +- [CreateOrUpdateAuthorizationRule](#eventhubs_createorupdateauthorizationrule) +- [Delete](#eventhubs_delete) +- [DeleteAuthorizationRule](#eventhubs_deleteauthorizationrule) +- [Get](#eventhubs_get) +- [GetAuthorizationRule](#eventhubs_getauthorizationrule) +- [ListAuthorizationRules](#eventhubs_listauthorizationrules) +- [ListByNamespace](#eventhubs_listbynamespace) +- [ListKeys](#eventhubs_listkeys) +- [RegenerateKeys](#eventhubs_regeneratekeys) + +## Namespaces + +- [CheckNameAvailability](#namespaces_checknameavailability) +- [CreateOrUpdate](#namespaces_createorupdate) +- [CreateOrUpdateAuthorizationRule](#namespaces_createorupdateauthorizationrule) +- [CreateOrUpdateNetworkRuleSet](#namespaces_createorupdatenetworkruleset) +- [Delete](#namespaces_delete) +- [DeleteAuthorizationRule](#namespaces_deleteauthorizationrule) +- [GetAuthorizationRule](#namespaces_getauthorizationrule) +- [GetByResourceGroup](#namespaces_getbyresourcegroup) +- [GetNetworkRuleSet](#namespaces_getnetworkruleset) +- [List](#namespaces_list) +- [ListAuthorizationRules](#namespaces_listauthorizationrules) +- [ListByResourceGroup](#namespaces_listbyresourcegroup) +- [ListKeys](#namespaces_listkeys) +- [ListNetworkRuleSet](#namespaces_listnetworkruleset) +- [RegenerateKeys](#namespaces_regeneratekeys) +- [Update](#namespaces_update) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) + +## SchemaRegistry + +- [CreateOrUpdate](#schemaregistry_createorupdate) +- [Delete](#schemaregistry_delete) +- [Get](#schemaregistry_get) +- [ListByNamespace](#schemaregistry_listbynamespace) +### Clusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.eventhubs.generated.models.ClusterSku; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterSkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters CreateOrUpdate. */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPut.json + */ + /** + * Sample code: ClusterPut. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterPut(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .clusters() + .define("testCluster") + .withRegion("South Central US") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSku(new ClusterSku().withName(ClusterSkuName.DEDICATED).withCapacity(1)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Clusters_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterDelete.json + */ + /** + * Sample code: ClusterDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().delete("myResourceGroup", "testCluster", Context.NONE); + } +} +``` + +### Clusters_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterGet.json + */ + /** + * Sample code: ClusterGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().getByResourceGroupWithResponse("myResourceGroup", "testCluster", Context.NONE); + } +} +``` + +### Clusters_List + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListBySubscription.json + */ + /** + * Sample code: ClustersListBySubscription. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersListBySubscription( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().list(Context.NONE); + } +} +``` + +### Clusters_ListAvailableClusterRegion + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters ListAvailableClusterRegion. */ +public final class ClustersListAvailableClusterRegionSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListAvailableClustersGet.json + */ + /** + * Sample code: ListAvailableClusters. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listAvailableClusters(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().listAvailableClusterRegionWithResponse(Context.NONE); + } +} +``` + +### Clusters_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListByResourceGroup.json + */ + /** + * Sample code: ClustersListByResourceGroup. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersListByResourceGroup( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### Clusters_ListNamespaces + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters ListNamespaces. */ +public final class ClustersListNamespacesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListNamespacesInClusterGet.json + */ + /** + * Sample code: ListNamespacesInCluster. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listNamespacesInCluster(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().listNamespacesWithResponse("myResourceGroup", "testCluster", Context.NONE); + } +} +``` + +### Clusters_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.Cluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPatch.json + */ + /** + * Sample code: ClusterPatch. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterPatch(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("myResourceGroup", "testCluster", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag3", "value3", "tag4", "value4")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Configuration_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Configuration Get. */ +public final class ConfigurationGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationGet.json + */ + /** + * Sample code: ClustersQuotasConfigurationGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersQuotasConfigurationGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.configurations().getWithResponse("myResourceGroup", "testCluster", Context.NONE); + } +} +``` + +### Configuration_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Configuration Patch. */ +public final class ConfigurationPatchSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationPatch.json + */ + /** + * Sample code: ClustersQuotasConfigurationPatch. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersQuotasConfigurationPatch( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .configurations() + .patchWithResponse( + "ArunMonocle", + "testCluster", + new ClusterQuotaConfigurationPropertiesInner() + .withSettings(mapOf("eventhub-per-namespace-quota", "20", "namespaces-per-cluster-quota", "200")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ConsumerGroups_CreateOrUpdate + +```java +/** Samples for ConsumerGroups CreateOrUpdate. */ +public final class ConsumerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupCreate.json + */ + /** + * Sample code: ConsumerGroupCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .define("sdk-ConsumerGroup-5563") + .withExistingEventhub("ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681") + .withUserMetadata("New consumergroup") + .create(); + } +} +``` + +### ConsumerGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ConsumerGroups Delete. */ +public final class ConsumerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupDelete.json + */ + /** + * Sample code: ConsumerGroupDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .deleteWithResponse( + "ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", "sdk-ConsumerGroup-5563", Context.NONE); + } +} +``` + +### ConsumerGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ConsumerGroups Get. */ +public final class ConsumerGroupsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupGet.json + */ + /** + * Sample code: ConsumerGroupGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .getWithResponse( + "ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", "sdk-ConsumerGroup-5563", Context.NONE); + } +} +``` + +### ConsumerGroups_ListByEventHub + +```java +import com.azure.core.util.Context; + +/** Samples for ConsumerGroups ListByEventHub. */ +public final class ConsumerGroupsListByEventHubSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupListByEventHub.json + */ + /** + * Sample code: ConsumerGroupsListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupsListAll(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .listByEventHub("ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", null, null, Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_BreakPairing + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs BreakPairing. */ +public final class DisasterRecoveryConfigsBreakPairingSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasBreakPairing.json + */ + /** + * Sample code: EHAliasBreakPairing. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasBreakPairing(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .breakPairingWithResponse( + "exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; + +/** Samples for DisasterRecoveryConfigs CheckNameAvailability. */ +public final class DisasterRecoveryConfigsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCheckNameAvailability.json + */ + /** + * Sample code: NamespacesCheckNameAvailability. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesCheckNameAvailability( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .checkNameAvailabilityWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + new CheckNameAvailabilityParameter().withName("sdk-DisasterRecovery-9474"), + Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_CreateOrUpdate + +```java +/** Samples for DisasterRecoveryConfigs CreateOrUpdate. */ +public final class DisasterRecoveryConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCreate.json + */ + /** + * Sample code: EHAliasCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .define("sdk-DisasterRecovery-3814") + .withExistingNamespace("exampleResourceGroup", "sdk-Namespace-8859") + .withPartnerNamespace("sdk-Namespace-37") + .create(); + } +} +``` + +### DisasterRecoveryConfigs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Delete. */ +public final class DisasterRecoveryConfigsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasDelete.json + */ + /** + * Sample code: EHAliasDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .deleteWithResponse( + "exampleResourceGroup", "sdk-Namespace-5849", "sdk-DisasterRecovery-3814", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_FailOver + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs FailOver. */ +public final class DisasterRecoveryConfigsFailOverSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasFailOver.json + */ + /** + * Sample code: EHAliasFailOver. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasFailOver(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .failOverWithResponse( + "exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Get. */ +public final class DisasterRecoveryConfigsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasGet.json + */ + /** + * Sample code: EHAliasGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .getWithResponse("exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_GetAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs GetAuthorizationRule. */ +public final class DisasterRecoveryConfigsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleGet.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .getAuthorizationRuleWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + "sdk-DisasterRecovery-4879", + "sdk-Authrules-4879", + Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_List + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs List. */ +public final class DisasterRecoveryConfigsListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasList.json + */ + /** + * Sample code: EHAliasList. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasList(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.disasterRecoveryConfigs().list("exampleResourceGroup", "sdk-Namespace-8859", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_ListAuthorizationRules + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListAuthorizationRules. */ +public final class DisasterRecoveryConfigsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListAll.json + */ + /** + * Sample code: ListAuthorizationRules. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listAuthorizationRules(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .listAuthorizationRules( + "exampleResourceGroup", "sdk-Namespace-9080", "sdk-DisasterRecovery-4047", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListKeys. */ +public final class DisasterRecoveryConfigsListKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleListKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .listKeysWithResponse( + "exampleResourceGroup", + "sdk-Namespace-2702", + "sdk-DisasterRecovery-4047", + "sdk-Authrules-1746", + Context.NONE); + } +} +``` + +### EventHubs_CreateOrUpdate + +```java +import com.azure.resourcemanager.eventhubs.generated.models.CaptureDescription; +import com.azure.resourcemanager.eventhubs.generated.models.Destination; +import com.azure.resourcemanager.eventhubs.generated.models.EncodingCaptureDescription; +import com.azure.resourcemanager.eventhubs.generated.models.EntityStatus; + +/** Samples for EventHubs CreateOrUpdate. */ +public final class EventHubsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubCreate.json + */ + /** + * Sample code: EventHubCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .define("sdk-EventHub-6547") + .withExistingNamespace("Default-NotificationHubs-AustraliaEast", "sdk-Namespace-5357") + .withMessageRetentionInDays(4L) + .withPartitionCount(4L) + .withStatus(EntityStatus.ACTIVE) + .withCaptureDescription( + new CaptureDescription() + .withEnabled(true) + .withEncoding(EncodingCaptureDescription.AVRO) + .withIntervalInSeconds(120) + .withSizeLimitInBytes(10485763) + .withDestination( + new Destination() + .withName("EventHubArchive.AzureBlockBlob") + .withStorageAccountResourceId( + "/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage") + .withBlobContainer("container") + .withArchiveNameFormat( + "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"))) + .create(); + } +} +``` + +### EventHubs_CreateOrUpdateAuthorizationRule + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for EventHubs CreateOrUpdateAuthorizationRule. */ +public final class EventHubsCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleCreate.json + */ + /** + * Sample code: EventHubAuthorizationRuleCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .createOrUpdateAuthorizationRuleWithResponse( + "ArunMonocle", + "sdk-Namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-2513", + new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} +``` + +### EventHubs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs Delete. */ +public final class EventHubsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubDelete.json + */ + /** + * Sample code: EventHubDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.eventHubs().deleteWithResponse("ArunMonocle", "sdk-Namespace-5357", "sdk-EventHub-6547", Context.NONE); + } +} +``` + +### EventHubs_DeleteAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs DeleteAuthorizationRule. */ +public final class EventHubsDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleDelete.json + */ + /** + * Sample code: EventHubAuthorizationRuleDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleDelete( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); + } +} +``` + +### EventHubs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs Get. */ +public final class EventHubsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubGet.json + */ + /** + * Sample code: EventHubGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .getWithResponse( + "Default-NotificationHubs-AustraliaEast", "sdk-Namespace-716", "sdk-EventHub-10", Context.NONE); + } +} +``` + +### EventHubs_GetAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs GetAuthorizationRule. */ +public final class EventHubsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleGet.json + */ + /** + * Sample code: EventHubAuthorizationRuleGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .getAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); + } +} +``` + +### EventHubs_ListAuthorizationRules + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs ListAuthorizationRules. */ +public final class EventHubsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListAll.json + */ + /** + * Sample code: EventHubAuthorizationRuleListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleListAll( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .listAuthorizationRules("ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", Context.NONE); + } +} +``` + +### EventHubs_ListByNamespace + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs ListByNamespace. */ +public final class EventHubsListByNamespaceSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubListByNameSpace.json + */ + /** + * Sample code: EventHubsListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubsListAll(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .listByNamespace("Default-NotificationHubs-AustraliaEast", "sdk-Namespace-5357", null, null, Context.NONE); + } +} +``` + +### EventHubs_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for EventHubs ListKeys. */ +public final class EventHubsListKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListKey.json + */ + /** + * Sample code: EventHubAuthorizationRuleListKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleListKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .listKeysWithResponse( + "ArunMonocle", "sdk-namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); + } +} +``` + +### EventHubs_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.KeyType; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; + +/** Samples for EventHubs RegenerateKeys. */ +public final class EventHubsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: EventHubAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-1534", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + +### Namespaces_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; + +/** Samples for Namespaces CheckNameAvailability. */ +public final class NamespacesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json + */ + /** + * Sample code: NamespacesCheckNameAvailability. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesCheckNameAvailability( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameter().withName("sdk-Namespace-8458"), Context.NONE); + } +} +``` + +### Namespaces_CreateOrUpdate + +```java +import com.azure.resourcemanager.eventhubs.generated.models.Encryption; +import com.azure.resourcemanager.eventhubs.generated.models.Identity; +import com.azure.resourcemanager.eventhubs.generated.models.KeySource; +import com.azure.resourcemanager.eventhubs.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.eventhubs.generated.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.eventhubs.generated.models.UserAssignedIdentity; +import com.azure.resourcemanager.eventhubs.generated.models.UserAssignedIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces CreateOrUpdate. */ +public final class NamespacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCreate.json + */ + /** + * Sample code: NamespaceCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespaceCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .define("NamespaceSample") + .withRegion("East US") + .withExistingResourceGroup("ResurceGroupSample") + .withIdentity( + new Identity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1", + new UserAssignedIdentity(), + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2", + new UserAssignedIdentity()))) + .withClusterArmId( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/clusters/enc-test") + .withEncryption( + new Encryption() + .withKeyVaultProperties( + Arrays + .asList( + new KeyVaultProperties() + .withKeyName("Samplekey") + .withKeyVaultUri("https://aprao-keyvault-user.vault-int.azure-int.net/") + .withIdentity( + new UserAssignedIdentityProperties() + .withUserAssignedIdentity( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1")))) + .withKeySource(KeySource.MICROSOFT_KEY_VAULT)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Namespaces_CreateOrUpdateAuthorizationRule + +```java +import com.azure.resourcemanager.eventhubs.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ +public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleCreate.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .defineAuthorizationRule("sdk-Authrules-1746") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-2702") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) + .create(); + } +} +``` + +### Namespaces_CreateOrUpdateNetworkRuleSet + +```java +import com.azure.core.util.Context; +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.NetworkRuleIpAction; +import com.azure.resourcemanager.eventhubs.generated.models.Subnet; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateNetworkRuleSet. */ +public final class NamespacesCreateOrUpdateNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetCreate.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceNetworkRuleSetCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .createOrUpdateNetworkRuleSetWithResponse( + "ResourceGroup", + "sdk-Namespace-6019", + new NetworkRuleSetInner() + .withDefaultAction(DefaultAction.DENY) + .withVirtualNetworkRules( + Arrays + .asList( + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2")) + .withIgnoreMissingVnetServiceEndpoint(true), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3")) + .withIgnoreMissingVnetServiceEndpoint(false), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6")) + .withIgnoreMissingVnetServiceEndpoint(false))) + .withIpRules( + Arrays + .asList( + new NWRuleSetIpRules().withIpMask("1.1.1.1").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.2").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.3").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.4").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.5").withAction(NetworkRuleIpAction.ALLOW))), + Context.NONE); + } +} +``` + +### Namespaces_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces Delete. */ +public final class NamespacesDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceDelete.json + */ + /** + * Sample code: NameSpaceDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().delete("ResurceGroupSample", "NamespaceSample", Context.NONE); + } +} +``` + +### Namespaces_DeleteAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces DeleteAuthorizationRule. */ +public final class NamespacesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleDelete.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleDelete( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-8980", "sdk-Authrules-8929", Context.NONE); + } +} +``` + +### Namespaces_GetAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetAuthorizationRule. */ +public final class NamespacesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleGet.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .getAuthorizationRuleWithResponse("ArunMonocle", "sdk-Namespace-2702", "sdk-Authrules-1746", Context.NONE); + } +} +``` + +### Namespaces_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetByResourceGroup. */ +public final class NamespacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceGet.json + */ + /** + * Sample code: NameSpaceGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().getByResourceGroupWithResponse("ResurceGroupSample", "NamespaceSample", Context.NONE); + } +} +``` + +### Namespaces_GetNetworkRuleSet + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetNetworkRuleSet. */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetGet.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceNetworkRuleSetGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().getNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} +``` + +### Namespaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces List. */ +public final class NamespacesListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceList.json + */ + /** + * Sample code: NamespacesListBySubscription. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesListBySubscription( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().list(Context.NONE); + } +} +``` + +### Namespaces_ListAuthorizationRules + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListAuthorizationRules. */ +public final class NamespacesListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json + */ + /** + * Sample code: ListAuthorizationRules. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listAuthorizationRules(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().listAuthorizationRules("ArunMonocle", "sdk-Namespace-2702", Context.NONE); + } +} +``` + +### Namespaces_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListByResourceGroup. */ +public final class NamespacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceListByResourceGroup.json + */ + /** + * Sample code: NamespaceListByResourceGroup. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespaceListByResourceGroup( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().listByResourceGroup("ResurceGroupSample", Context.NONE); + } +} +``` + +### Namespaces_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListKeys. */ +public final class NamespacesListKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleListKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .listKeysWithResponse("ArunMonocle", "sdk-Namespace-2702", "sdk-Authrules-1746", Context.NONE); + } +} +``` + +### Namespaces_ListNetworkRuleSet + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListNetworkRuleSet. */ +public final class NamespacesListNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetList.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetList. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceNetworkRuleSetList( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().listNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} +``` + +### Namespaces_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.KeyType; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Namespaces RegenerateKeys. */ +public final class NamespacesRegenerateKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-Namespace-8980", + "sdk-Authrules-8929", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + +### Namespaces_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespace; +import com.azure.resourcemanager.eventhubs.generated.models.Identity; +import com.azure.resourcemanager.eventhubs.generated.models.ManagedServiceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces Update. */ +public final class NamespacesUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceUpdate.json + */ + /** + * Sample code: NamespacesUpdate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesUpdate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + EHNamespace resource = + manager + .namespaces() + .getByResourceGroupWithResponse("ResurceGroupSample", "NamespaceSample", Context.NONE) + .getValue(); + resource + .update() + .withIdentity( + new Identity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2", + null))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EHOperations_List.json + */ + /** + * Sample code: EHOperations_List. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHOperationsList(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +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.PrivateLinkConnectionStatus; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateEndPointConnectionCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .privateEndpointConnections() + .define("privateEndpointConnectionName") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-2924") + .withPrivateEndpoint( + new PrivateEndpoint() + .withId( + "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-EventHub-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.REJECTED).withDescription("testing")) + .withProvisioningState(EndPointProvisioningState.SUCCEEDED) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateEndPointConnectionDelete( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .privateEndpointConnections() + .delete("ArunMonocle", "sdk-Namespace-3285", "928c44d5-b7c6-423b-b6fa-811e0c27b3e0", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateEndPointConnectionGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("SDK-EventHub-4794", "sdk-Namespace-5828", "privateEndpointConnectionName", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json + */ + /** + * Sample code: NameSpaceCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.privateEndpointConnections().list("SDK-EventHub-4794", "sdk-Namespace-5828", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateLinkResourcesGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateLinkResourcesGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.privateLinkResources().getWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE); + } +} +``` + +### SchemaRegistry_CreateOrUpdate + +```java +import com.azure.resourcemanager.eventhubs.generated.models.SchemaCompatibility; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SchemaRegistry CreateOrUpdate. */ +public final class SchemaRegistryCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryCreate.json + */ + /** + * Sample code: SchemaRegistryCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .schemaRegistries() + .define("testSchemaGroup1") + .withExistingNamespace("alitest", "ali-ua-test-eh-system-1") + .withGroupProperties(mapOf()) + .withSchemaCompatibility(SchemaCompatibility.FORWARD) + .withSchemaType(SchemaType.AVRO) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SchemaRegistry_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SchemaRegistry Delete. */ +public final class SchemaRegistryDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryDelete.json + */ + /** + * Sample code: SchemaRegistryDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .schemaRegistries() + .deleteWithResponse("alitest", "ali-ua-test-eh-system-1", "testSchemaGroup1", Context.NONE); + } +} +``` + +### SchemaRegistry_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SchemaRegistry Get. */ +public final class SchemaRegistryGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryGet.json + */ + /** + * Sample code: SchemaRegistryGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .schemaRegistries() + .getWithResponse("alitest", "ali-ua-test-eh-system-1", "testSchemaGroup1", Context.NONE); + } +} +``` + +### SchemaRegistry_ListByNamespace + +```java +import com.azure.core.util.Context; + +/** Samples for SchemaRegistry ListByNamespace. */ +public final class SchemaRegistryListByNamespaceSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryListByNamespace.json + */ + /** + * Sample code: SchemaRegistryListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryListAll(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.schemaRegistries().listByNamespace("alitest", "ali-ua-test-eh-system-1", null, null, Context.NONE); + } +} +``` + 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..a9970695d0a38 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/pom.xml @@ -0,0 +1,55 @@ + + 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-2021-11. + 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 + true + + + + com.azure + azure-core + 1.24.1 + + + com.azure + azure-core-management + 1.5.1 + + + 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..a3d347e5312fc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/EventHubsManager.java @@ -0,0 +1,355 @@ +// 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.HttpPipelinePosition; +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.SchemaRegistriesImpl; +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.SchemaRegistries; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 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 Configurations configurations; + + private Namespaces namespaces; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private Operations operations; + + private EventHubs eventHubs; + + private DisasterRecoveryConfigs disasterRecoveryConfigs; + + private ConsumerGroups consumerGroups; + + private SchemaRegistries schemaRegistries; + + 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()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + 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 Configurations. */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); + } + return configurations; + } + + /** @return Resource collection API of Namespaces. */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + } + return namespaces; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of EventHubs. */ + public EventHubs eventHubs() { + if (this.eventHubs == null) { + this.eventHubs = new EventHubsImpl(clientObject.getEventHubs(), this); + } + return eventHubs; + } + + /** @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 ConsumerGroups. */ + public ConsumerGroups consumerGroups() { + if (this.consumerGroups == null) { + this.consumerGroups = new ConsumerGroupsImpl(clientObject.getConsumerGroups(), this); + } + return consumerGroups; + } + + /** @return Resource collection API of SchemaRegistries. */ + public SchemaRegistries schemaRegistries() { + if (this.schemaRegistries == null) { + this.schemaRegistries = new SchemaRegistriesImpl(clientObject.getSchemaRegistries(), this); + } + return schemaRegistries; + } + + /** + * @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..c20c50bdd687e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/ClustersClient.java @@ -0,0 +1,321 @@ +// 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; +import reactor.core.publisher.Mono; + +/** 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableClusterRegionWithResponse(Context context); + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @throws com.azure.core.management.exception.ManagementException 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 list(); + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list(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 along with {@link Response}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response}. + */ + @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..c4405f05845f2 --- /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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @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..fa3d04435a298 --- /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 along with {@link Response}. + */ + @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 {@link 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 along with {@link Response}. + */ + @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..9264492650a84 --- /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 { + /** + * 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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @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 {@link 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 along with {@link Response}. + */ + @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 {@link 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response failOverWithResponse(String resourceGroupName, String namespaceName, String alias, 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 com.azure.core.management.exception.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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, 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..c4f0cf1577b60 --- /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 ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + ConfigurationsClient getConfigurations(); + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + NamespacesClient getNamespaces(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the EventHubsClient object to access its operations. + * + * @return the EventHubsClient object. + */ + EventHubsClient getEventHubs(); + + /** + * Gets the DisasterRecoveryConfigsClient object to access its operations. + * + * @return the DisasterRecoveryConfigsClient object. + */ + DisasterRecoveryConfigsClient getDisasterRecoveryConfigs(); + + /** + * Gets the ConsumerGroupsClient object to access its operations. + * + * @return the ConsumerGroupsClient object. + */ + ConsumerGroupsClient getConsumerGroups(); + + /** + * Gets the SchemaRegistriesClient object to access its operations. + * + * @return the SchemaRegistriesClient object. + */ + SchemaRegistriesClient getSchemaRegistries(); +} 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..01b1bb18ada30 --- /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 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 along with {@link Response}. + */ + @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 {@link 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, 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 com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @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 {@link 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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + 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..352087809d6e9 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/NamespacesClient.java @@ -0,0 +1,562 @@ +// 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.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; +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 NamespacesClient. */ +public interface NamespacesClient { + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of 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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, 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) + NetworkRuleSetListResultInner listNetworkRuleSet(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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listNetworkRuleSetWithResponse( + 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 along with {@link Response}. + */ + @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 {@link 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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response}. + */ + @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..656821db860de --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/PrivateEndpointConnectionsClient.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.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; +import reactor.core.publisher.Mono; + +/** 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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response}. + */ + @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..e48507af1b05c --- /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 along with {@link Response}. + */ + @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/SchemaRegistriesClient.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/SchemaRegistriesClient.java new file mode 100644 index 0000000000000..381bc7cce0cdf --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/SchemaRegistriesClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.SchemaGroupInner; + +/** An instance of this class provides access to all the operations defined in SchemaRegistriesClient. */ +public interface SchemaRegistriesClient { + /** + * Gets all the Schema Groups 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 Schema Groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets all the Schema Groups 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 Schema Groups in a Namespace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemaGroupInner createOrUpdate( + String resourceGroupName, String namespaceName, String schemaGroupName, SchemaGroupInner parameters); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String schemaGroupName, + SchemaGroupInner parameters, + Context context); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 schemaGroupName); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemaGroupInner get(String resourceGroupName, String namespaceName, String schemaGroupName); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, 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..06502d5a3c374 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryInner.java @@ -0,0 +1,155 @@ +// 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.ProxyResource; +import com.azure.core.management.SystemData; +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. */ +@Fluent +public final class ArmDisasterRecoveryInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryInner.class); + + /* + * Properties required to the Create Or Update Alias(Disaster Recovery + * configurations) + */ + @JsonProperty(value = "properties") + private ArmDisasterRecoveryProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: Properties required to the Create Or Update Alias(Disaster Recovery + * configurations). + * + * @return the innerProperties value. + */ + private ArmDisasterRecoveryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ArmDisasterRecoveryProperties(); + } + this.innerProperties().withPartnerNamespace(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ArmDisasterRecoveryProperties(); + } + this.innerProperties().withAlternateName(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.innerProperties() == null ? null : this.innerProperties().role(); + } + + /** + * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.innerProperties() == null ? null : this.innerProperties().pendingReplicationOperationsCount(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryProperties.java new file mode 100644 index 0000000000000..5103caf4a5375 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ArmDisasterRecoveryProperties.java @@ -0,0 +1,130 @@ +// 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.ProvisioningStateDR; +import com.azure.resourcemanager.eventhubs.generated.models.RoleDisasterRecovery; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties required to the Create Or Update Alias(Disaster Recovery configurations). */ +@Fluent +public final class ArmDisasterRecoveryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmDisasterRecoveryProperties.class); + + /* + * Provisioning state of the Alias(Disaster Recovery configuration) - + * possible values 'Accepted' or 'Succeeded' or 'Failed' + */ + @JsonProperty(value = "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 = "partnerNamespace") + private String partnerNamespace; + + /* + * Alternate name specified when alias and namespace names are same. + */ + @JsonProperty(value = "alternateName") + private String alternateName; + + /* + * role of namespace in GEO DR - possible values 'Primary' or + * 'PrimaryNotReplicating' or 'Secondary' + */ + @JsonProperty(value = "role", access = JsonProperty.Access.WRITE_ONLY) + private RoleDisasterRecovery role; + + /* + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "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 ArmDisasterRecoveryProperties object itself. + */ + public ArmDisasterRecoveryProperties 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 ArmDisasterRecoveryProperties object itself. + */ + public ArmDisasterRecoveryProperties 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..a419328170c40 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +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. */ +@Fluent +public final class AuthorizationRuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleInner.class); + + /* + * Properties supplied to create or update AuthorizationRule + */ + @JsonProperty(value = "properties") + private AuthorizationRuleProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: Properties supplied to create or update AuthorizationRule. + * + * @return the innerProperties value. + */ + private AuthorizationRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the rights property: The rights associated with the rule. + * + * @return the rights value. + */ + public List rights() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthorizationRuleProperties(); + } + this.innerProperties().withRights(rights); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleProperties.java new file mode 100644 index 0000000000000..843bb41de4ba4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/AuthorizationRuleProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +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; + +/** Properties supplied to create or update AuthorizationRule. */ +@Fluent +public final class AuthorizationRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleProperties.class); + + /* + * The rights associated with the rule. + */ + @JsonProperty(value = "rights", required = true) + 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 AuthorizationRuleProperties object itself. + */ + public AuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rights() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rights in model AuthorizationRuleProperties")); + } + } +} 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..f7d7bbce3f54b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +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. */ +@Fluent +public final 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 system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Event Hubs Cluster properties supplied in responses in List or Get + * operations. + */ + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; + + /** + * 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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Event Hubs Cluster properties supplied in responses in List or Get operations. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().metricId(); + } + + /** + * Get the status property: Status of the Cluster resource. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterProperties.java new file mode 100644 index 0000000000000..771fde2f435af --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ClusterProperties.java @@ -0,0 +1,86 @@ +// 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; + +/** Event Hubs Cluster properties supplied in responses in List or Get operations. */ +@Immutable +public final class ClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterProperties.class); + + /* + * The UTC time when the Event Hubs Cluster was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * The UTC time when the Event Hubs Cluster was last updated. + */ + @JsonProperty(value = "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 = "metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Status of the Cluster resource + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * 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; + } + + /** + * 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/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..f21d30f5dd154 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupInner.java @@ -0,0 +1,120 @@ +// 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.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Single item in List or Get Consumer group operation. */ +@Fluent +public final class ConsumerGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupInner.class); + + /* + * Single item in List or Get Consumer group operation + */ + @JsonProperty(value = "properties") + private ConsumerGroupProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: Single item in List or Get Consumer group operation. + * + * @return the innerProperties value. + */ + private ConsumerGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsumerGroupProperties(); + } + this.innerProperties().withUserMetadata(userMetadata); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupProperties.java new file mode 100644 index 0000000000000..4d97b2ba3a44a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/ConsumerGroupProperties.java @@ -0,0 +1,88 @@ +// 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.JsonProperty; +import java.time.OffsetDateTime; + +/** Single item in List or Get Consumer group operation. */ +@Fluent +public final class ConsumerGroupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsumerGroupProperties.class); + + /* + * Exact time the message was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "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 = "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 ConsumerGroupProperties object itself. + */ + public ConsumerGroupProperties 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/DestinationProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/DestinationProperties.java new file mode 100644 index 0000000000000..2ca18cb95578d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/DestinationProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.JsonProperty; +import java.util.UUID; + +/** Properties describing the storage account, blob container and archive name format for capture destination. */ +@Fluent +public final class DestinationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationProperties.class); + + /* + * Resource id of the storage account to be used to create the blobs + */ + @JsonProperty(value = "storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Blob container Name + */ + @JsonProperty(value = "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 = "archiveNameFormat") + private String archiveNameFormat; + + /* + * Subscription Id of Azure Data Lake Store + */ + @JsonProperty(value = "dataLakeSubscriptionId") + private UUID dataLakeSubscriptionId; + + /* + * The Azure Data Lake Store name for the captured events + */ + @JsonProperty(value = "dataLakeAccountName") + private String dataLakeAccountName; + + /* + * The destination folder path for the captured events + */ + @JsonProperty(value = "dataLakeFolderPath") + private String dataLakeFolderPath; + + /** + * 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 DestinationProperties object itself. + */ + public DestinationProperties 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 DestinationProperties object itself. + */ + public DestinationProperties 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 DestinationProperties object itself. + */ + public DestinationProperties withArchiveNameFormat(String archiveNameFormat) { + this.archiveNameFormat = archiveNameFormat; + return this; + } + + /** + * Get the dataLakeSubscriptionId property: Subscription Id of Azure Data Lake Store. + * + * @return the dataLakeSubscriptionId value. + */ + public UUID dataLakeSubscriptionId() { + return this.dataLakeSubscriptionId; + } + + /** + * Set the dataLakeSubscriptionId property: Subscription Id of Azure Data Lake Store. + * + * @param dataLakeSubscriptionId the dataLakeSubscriptionId value to set. + * @return the DestinationProperties object itself. + */ + public DestinationProperties withDataLakeSubscriptionId(UUID dataLakeSubscriptionId) { + this.dataLakeSubscriptionId = dataLakeSubscriptionId; + return this; + } + + /** + * Get the dataLakeAccountName property: The Azure Data Lake Store name for the captured events. + * + * @return the dataLakeAccountName value. + */ + public String dataLakeAccountName() { + return this.dataLakeAccountName; + } + + /** + * Set the dataLakeAccountName property: The Azure Data Lake Store name for the captured events. + * + * @param dataLakeAccountName the dataLakeAccountName value to set. + * @return the DestinationProperties object itself. + */ + public DestinationProperties withDataLakeAccountName(String dataLakeAccountName) { + this.dataLakeAccountName = dataLakeAccountName; + return this; + } + + /** + * Get the dataLakeFolderPath property: The destination folder path for the captured events. + * + * @return the dataLakeFolderPath value. + */ + public String dataLakeFolderPath() { + return this.dataLakeFolderPath; + } + + /** + * Set the dataLakeFolderPath property: The destination folder path for the captured events. + * + * @param dataLakeFolderPath the dataLakeFolderPath value to set. + * @return the DestinationProperties object itself. + */ + public DestinationProperties withDataLakeFolderPath(String dataLakeFolderPath) { + this.dataLakeFolderPath = dataLakeFolderPath; + 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..53287bc6c4126 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceInner.java @@ -0,0 +1,405 @@ +// 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.management.SystemData; +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.List; +import java.util.Map; + +/** Single Namespace item in List or Get Operation. */ +@Fluent +public final 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; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Namespace properties supplied for create namespace operation. + */ + @JsonProperty(value = "properties") + private EHNamespaceProperties innerProperties; + + /** + * 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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Namespace properties supplied for create namespace operation. + * + * @return the innerProperties value. + */ + private EHNamespaceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public EHNamespaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public EHNamespaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Namespace. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: Status of the Namespace. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the createdAt property: The time the Namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); + } + + /** + * Get the updatedAt property: The time the Namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); + } + + /** + * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); + } + + /** + * Get the clusterArmId property: Cluster ARM ID of the Namespace. + * + * @return the clusterArmId value. + */ + public String clusterArmId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withClusterArmId(clusterArmId); + return this; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.innerProperties() == null ? null : this.innerProperties().metricId(); + } + + /** + * Get the isAutoInflateEnabled property: Value that indicates whether AutoInflate is enabled for eventhub + * namespace. + * + * @return the isAutoInflateEnabled value. + */ + public Boolean isAutoInflateEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withIsAutoInflateEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withMaximumThroughputUnits(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withKafkaEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withZoneRedundant(zoneRedundant); + return this; + } + + /** + * Get the encryption property: Properties of BYOK Encryption description. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withPrivateEndpointConnections( + List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Event Hubs namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.innerProperties() == null ? null : this.innerProperties().disableLocalAuth(); + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Event Hubs namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withDisableLocalAuth(Boolean disableLocalAuth) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withDisableLocalAuth(disableLocalAuth); + 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.innerProperties() == null ? null : this.innerProperties().alternateName(); + } + + /** + * Set the alternateName property: Alternate name specified when alias and namespace names are same. + * + * @param alternateName the alternateName value to set. + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withAlternateName(String alternateName) { + if (this.innerProperties() == null) { + this.innerProperties = new EHNamespaceProperties(); + } + this.innerProperties().withAlternateName(alternateName); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceProperties.java new file mode 100644 index 0000000000000..60a58f33eb17c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EHNamespaceProperties.java @@ -0,0 +1,368 @@ +// 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.Encryption; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Namespace properties supplied for create namespace operation. */ +@Fluent +public final class EHNamespaceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EHNamespaceProperties.class); + + /* + * Provisioning state of the Namespace. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Status of the Namespace. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The time the Namespace was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The time the Namespace was updated. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Endpoint you can use to perform Service Bus operations. + */ + @JsonProperty(value = "serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceBusEndpoint; + + /* + * Cluster ARM ID of the Namespace. + */ + @JsonProperty(value = "clusterArmId") + private String clusterArmId; + + /* + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Value that indicates whether AutoInflate is enabled for eventhub + * namespace. + */ + @JsonProperty(value = "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 = "maximumThroughputUnits") + private Integer maximumThroughputUnits; + + /* + * Value that indicates whether Kafka is enabled for eventhub namespace. + */ + @JsonProperty(value = "kafkaEnabled") + private Boolean kafkaEnabled; + + /* + * Enabling this property creates a Standard Event Hubs Namespace in + * regions supported availability zones. + */ + @JsonProperty(value = "zoneRedundant") + private Boolean zoneRedundant; + + /* + * Properties of BYOK Encryption description + */ + @JsonProperty(value = "encryption") + private Encryption encryption; + + /* + * List of private endpoint connections. + */ + @JsonProperty(value = "privateEndpointConnections") + private List privateEndpointConnections; + + /* + * This property disables SAS authentication for the Event Hubs namespace. + */ + @JsonProperty(value = "disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * Alternate name specified when alias and namespace names are same. + */ + @JsonProperty(value = "alternateName") + private String alternateName; + + /** + * 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the EHNamespaceProperties object itself. + */ + public EHNamespaceProperties withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Event Hubs namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Event Hubs namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the EHNamespaceProperties object itself. + */ + public EHNamespaceProperties withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + 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 EHNamespaceProperties object itself. + */ + public EHNamespaceProperties withAlternateName(String alternateName) { + this.alternateName = alternateName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryption() != null) { + encryption().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.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..d9dc5e3171b6a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubInner.java @@ -0,0 +1,201 @@ +// 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.ProxyResource; +import com.azure.core.management.SystemData; +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. */ +@Fluent +public final class EventhubInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventhubInner.class); + + /* + * Properties supplied to the Create Or Update Event Hub operation. + */ + @JsonProperty(value = "properties") + private EventhubProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: Properties supplied to the Create Or Update Event Hub operation. + * + * @return the innerProperties value. + */ + private EventhubProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the partitionIds property: Current number of shards on the Event Hub. + * + * @return the partitionIds value. + */ + public List partitionIds() { + return this.innerProperties() == null ? null : this.innerProperties().partitionIds(); + } + + /** + * Get the createdAt property: Exact time the Event Hub was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EventhubProperties(); + } + this.innerProperties().withMessageRetentionInDays(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EventhubProperties(); + } + this.innerProperties().withPartitionCount(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EventhubProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the captureDescription property: Properties of capture description. + * + * @return the captureDescription value. + */ + public CaptureDescription captureDescription() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EventhubProperties(); + } + this.innerProperties().withCaptureDescription(captureDescription); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubProperties.java new file mode 100644 index 0000000000000..9b553bef13cac --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/EventhubProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +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; + +/** Properties supplied to the Create Or Update Event Hub operation. */ +@Fluent +public final class EventhubProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventhubProperties.class); + + /* + * Current number of shards on the Event Hub. + */ + @JsonProperty(value = "partitionIds", access = JsonProperty.Access.WRITE_ONLY) + private List partitionIds; + + /* + * Exact time the Event Hub was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "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 = "messageRetentionInDays") + private Long messageRetentionInDays; + + /* + * Number of partitions created for the Event Hub, allowed values are from + * 1 to 32 partitions. + */ + @JsonProperty(value = "partitionCount") + private Long partitionCount; + + /* + * Enumerates the possible values for the status of the Event Hub. + */ + @JsonProperty(value = "status") + private EntityStatus status; + + /* + * Properties of capture description + */ + @JsonProperty(value = "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 EventhubProperties object itself. + */ + public EventhubProperties 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 EventhubProperties object itself. + */ + public EventhubProperties 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 EventhubProperties object itself. + */ + public EventhubProperties 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 EventhubProperties object itself. + */ + public EventhubProperties 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/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..4acfa71124142 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetInner.java @@ -0,0 +1,198 @@ +// 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.ProxyResource; +import com.azure.core.management.SystemData; +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.azure.resourcemanager.eventhubs.generated.models.PublicNetworkAccessFlag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of topic resource. */ +@Fluent +public final class NetworkRuleSetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetInner.class); + + /* + * NetworkRuleSet properties + */ + @JsonProperty(value = "properties") + private NetworkRuleSetProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: NetworkRuleSet properties. + * + * @return the innerProperties value. + */ + private NetworkRuleSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + public Boolean trustedServiceAccessEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withTrustedServiceAccessEnabled(trustedServiceAccessEnabled); + return this; + } + + /** + * Get the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withDefaultAction(defaultAction); + return this; + } + + /** + * Get the virtualNetworkRules property: List VirtualNetwork Rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withVirtualNetworkRules(virtualNetworkRules); + return this; + } + + /** + * Get the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withIpRules(ipRules); + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessFlag publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withPublicNetworkAccess(PublicNetworkAccessFlag publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetListResultInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetListResultInner.java new file mode 100644 index 0000000000000..46c818b7ae5ed --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetListResultInner.java @@ -0,0 +1,83 @@ +// 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.JsonProperty; +import java.util.List; + +/** The response of the List NetworkRuleSet operation. */ +@Fluent +public final class NetworkRuleSetListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetListResultInner.class); + + /* + * Result of the List NetworkRuleSet operation + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of NetworkRuleSet. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List NetworkRuleSet operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List NetworkRuleSet operation. + * + * @param value the value value to set. + * @return the NetworkRuleSetListResultInner object itself. + */ + public NetworkRuleSetListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @param nextLink the nextLink value to set. + * @return the NetworkRuleSetListResultInner object itself. + */ + public NetworkRuleSetListResultInner 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/NetworkRuleSetProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetProperties.java new file mode 100644 index 0000000000000..b48c4c4068713 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/NetworkRuleSetProperties.java @@ -0,0 +1,170 @@ +// 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.DefaultAction; +import com.azure.resourcemanager.eventhubs.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.eventhubs.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.eventhubs.generated.models.PublicNetworkAccessFlag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkRuleSet properties. */ +@Fluent +public final class NetworkRuleSetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSetProperties.class); + + /* + * Value that indicates whether Trusted Service Access is Enabled or not. + */ + @JsonProperty(value = "trustedServiceAccessEnabled") + private Boolean trustedServiceAccessEnabled; + + /* + * Default Action for Network Rule Set + */ + @JsonProperty(value = "defaultAction") + private DefaultAction defaultAction; + + /* + * List VirtualNetwork Rules + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /* + * List of IpRules + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /* + * This determines if traffic is allowed over public network. By default it + * is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccessFlag publicNetworkAccess; + + /** + * 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 NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties 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 NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties 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 NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties 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 NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessFlag publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties withPublicNetworkAccess(PublicNetworkAccessFlag publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/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..5a462082e0d45 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/OperationInner.java @@ -0,0 +1,147 @@ +// 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; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * 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..572176d7781bc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,147 @@ +// 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.ProxyResource; +import com.azure.core.management.SystemData; +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. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * Properties of the PrivateEndpointConnection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: Properties of the PrivateEndpointConnection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + public EndPointProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..9b7b323de9eea --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,112 @@ +// 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.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 private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * The Private Endpoint resource for this Connection. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Details about the state of the connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private ConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the Private Endpoint Connection. + */ + @JsonProperty(value = "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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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/PrivateLinkResourceProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..c0a50618a032e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,103 @@ +// 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.JsonProperty; +import java.util.List; + +/** Properties of PrivateLinkResource. */ +@Fluent +public final class PrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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/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/SchemaGroupInner.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/SchemaGroupInner.java new file mode 100644 index 0000000000000..b63c5bffb0ac8 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/SchemaGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaCompatibility; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** Single item in List or Get Schema Group operation. */ +@Fluent +public final class SchemaGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaGroupInner.class); + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private SchemaGroupProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private SchemaGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the updatedAtUtc property: Exact time the Schema Group was updated. + * + * @return the updatedAtUtc value. + */ + public OffsetDateTime updatedAtUtc() { + return this.innerProperties() == null ? null : this.innerProperties().updatedAtUtc(); + } + + /** + * Get the createdAtUtc property: Exact time the Schema Group was created. + * + * @return the createdAtUtc value. + */ + public OffsetDateTime createdAtUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdAtUtc(); + } + + /** + * Get the etag property: The ETag value. + * + * @return the etag value. + */ + public UUID etag() { + return this.innerProperties() == null ? null : this.innerProperties().etag(); + } + + /** + * Get the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @return the groupProperties value. + */ + public Map groupProperties() { + return this.innerProperties() == null ? null : this.innerProperties().groupProperties(); + } + + /** + * Set the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @param groupProperties the groupProperties value to set. + * @return the SchemaGroupInner object itself. + */ + public SchemaGroupInner withGroupProperties(Map groupProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SchemaGroupProperties(); + } + this.innerProperties().withGroupProperties(groupProperties); + return this; + } + + /** + * Get the schemaCompatibility property: The schemaCompatibility property. + * + * @return the schemaCompatibility value. + */ + public SchemaCompatibility schemaCompatibility() { + return this.innerProperties() == null ? null : this.innerProperties().schemaCompatibility(); + } + + /** + * Set the schemaCompatibility property: The schemaCompatibility property. + * + * @param schemaCompatibility the schemaCompatibility value to set. + * @return the SchemaGroupInner object itself. + */ + public SchemaGroupInner withSchemaCompatibility(SchemaCompatibility schemaCompatibility) { + if (this.innerProperties() == null) { + this.innerProperties = new SchemaGroupProperties(); + } + this.innerProperties().withSchemaCompatibility(schemaCompatibility); + return this; + } + + /** + * Get the schemaType property: The schemaType property. + * + * @return the schemaType value. + */ + public SchemaType schemaType() { + return this.innerProperties() == null ? null : this.innerProperties().schemaType(); + } + + /** + * Set the schemaType property: The schemaType property. + * + * @param schemaType the schemaType value to set. + * @return the SchemaGroupInner object itself. + */ + public SchemaGroupInner withSchemaType(SchemaType schemaType) { + if (this.innerProperties() == null) { + this.innerProperties = new SchemaGroupProperties(); + } + this.innerProperties().withSchemaType(schemaType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/SchemaGroupProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/SchemaGroupProperties.java new file mode 100644 index 0000000000000..9b91954604ea8 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/fluent/models/SchemaGroupProperties.java @@ -0,0 +1,154 @@ +// 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.SchemaCompatibility; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** The SchemaGroupProperties model. */ +@Fluent +public final class SchemaGroupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaGroupProperties.class); + + /* + * Exact time the Schema Group was updated + */ + @JsonProperty(value = "updatedAtUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAtUtc; + + /* + * Exact time the Schema Group was created. + */ + @JsonProperty(value = "createdAtUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAtUtc; + + /* + * The ETag value. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private UUID etag; + + /* + * dictionary object for SchemaGroup group properties + */ + @JsonProperty(value = "groupProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map groupProperties; + + /* + * The schemaCompatibility property. + */ + @JsonProperty(value = "schemaCompatibility") + private SchemaCompatibility schemaCompatibility; + + /* + * The schemaType property. + */ + @JsonProperty(value = "schemaType") + private SchemaType schemaType; + + /** + * Get the updatedAtUtc property: Exact time the Schema Group was updated. + * + * @return the updatedAtUtc value. + */ + public OffsetDateTime updatedAtUtc() { + return this.updatedAtUtc; + } + + /** + * Get the createdAtUtc property: Exact time the Schema Group was created. + * + * @return the createdAtUtc value. + */ + public OffsetDateTime createdAtUtc() { + return this.createdAtUtc; + } + + /** + * Get the etag property: The ETag value. + * + * @return the etag value. + */ + public UUID etag() { + return this.etag; + } + + /** + * Get the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @return the groupProperties value. + */ + public Map groupProperties() { + return this.groupProperties; + } + + /** + * Set the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @param groupProperties the groupProperties value to set. + * @return the SchemaGroupProperties object itself. + */ + public SchemaGroupProperties withGroupProperties(Map groupProperties) { + this.groupProperties = groupProperties; + return this; + } + + /** + * Get the schemaCompatibility property: The schemaCompatibility property. + * + * @return the schemaCompatibility value. + */ + public SchemaCompatibility schemaCompatibility() { + return this.schemaCompatibility; + } + + /** + * Set the schemaCompatibility property: The schemaCompatibility property. + * + * @param schemaCompatibility the schemaCompatibility value to set. + * @return the SchemaGroupProperties object itself. + */ + public SchemaGroupProperties withSchemaCompatibility(SchemaCompatibility schemaCompatibility) { + this.schemaCompatibility = schemaCompatibility; + return this; + } + + /** + * Get the schemaType property: The schemaType property. + * + * @return the schemaType value. + */ + public SchemaType schemaType() { + return this.schemaType; + } + + /** + * Set the schemaType property: The schemaType property. + * + * @param schemaType the schemaType value to set. + * @return the SchemaGroupProperties object itself. + */ + public SchemaGroupProperties withSchemaType(SchemaType schemaType) { + this.schemaType = schemaType; + 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..a2a24dda84205 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ArmDisasterRecoveryImpl.java @@ -0,0 +1,200 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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..f5e5054557fa0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/AuthorizationRuleImpl.java @@ -0,0 +1,192 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public List rights() { + List inner = this.innerModel().rights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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..3a1fed825f745 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClusterImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..a02ab70ef76f5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersClientImpl.java @@ -0,0 +1,1838 @@ +// 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}/providers/Microsoft.EventHub/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @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> listBySubscriptionNext( + @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); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableClusterRegionWithResponse(Context context) { + return listAvailableClusterRegionWithResponseAsync(context).block(); + } + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @throws ManagementException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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.getSubscriptionId(), + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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.getSubscriptionId(), + 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. + * + * @throws ManagementException 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 listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @throws ManagementException 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 list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list(Context context) { + return new PagedIterable<>(listAsync(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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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 + .listBySubscriptionNext(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 Event Hubs Clusters operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..34e8df46f8301 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ClustersImpl.java @@ -0,0 +1,221 @@ +// 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 list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + 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..6a242f1c7dc6d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConfigurationsClientImpl.java @@ -0,0 +1,430 @@ +// 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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..f08b0903c96b0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupImpl.java @@ -0,0 +1,170 @@ +// 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.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public String userMetadata() { + return this.innerModel().userMetadata(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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..1847751184022 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsClientImpl.java @@ -0,0 +1,1079 @@ +// 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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..aae69abbbd559 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/ConsumerGroupsImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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); + } + + 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..b7cd609737bdc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/DisasterRecoveryConfigsClientImpl.java @@ -0,0 +1,2135 @@ +// 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"}) + @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, 204}) + @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( + "/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"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the give Namespace name availability. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param parameters Parameters to check availability of the given 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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) along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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) along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link 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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, 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. + * @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List Alias(Disaster Recovery configuration) operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 from the List namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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/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..596256d68e185 --- /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 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 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 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); + } + + 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..f307ae040681e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EHNamespaceImpl.java @@ -0,0 +1,306 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateEndpointConnectionInner; +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.PrivateEndpointConnection; +import com.azure.resourcemanager.eventhubs.generated.models.Sku; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public String serviceBusEndpoint() { + return this.innerModel().serviceBusEndpoint(); + } + + public String 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 List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableLocalAuth() { + return this.innerModel().disableLocalAuth(); + } + + public String alternateName() { + return this.innerModel().alternateName(); + } + + 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; + } + + public EHNamespaceImpl withPrivateEndpointConnections( + List privateEndpointConnections) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + public EHNamespaceImpl withDisableLocalAuth(Boolean disableLocalAuth) { + this.innerModel().withDisableLocalAuth(disableLocalAuth); + return this; + } + + public EHNamespaceImpl 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/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..e338988b230ba --- /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.SchemaRegistriesClient; +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 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 NamespacesClient object to access its operations. */ + private final NamespacesClient namespaces; + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + public NamespacesClient getNamespaces() { + return this.namespaces; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The 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 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 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 SchemaRegistriesClient object to access its operations. */ + private final SchemaRegistriesClient schemaRegistries; + + /** + * Gets the SchemaRegistriesClient object to access its operations. + * + * @return the SchemaRegistriesClient object. + */ + public SchemaRegistriesClient getSchemaRegistries() { + return this.schemaRegistries; + } + + /** + * 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 = "2021-11-01"; + this.clusters = new ClustersClientImpl(this); + this.configurations = new ConfigurationsClientImpl(this); + this.namespaces = new NamespacesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.eventHubs = new EventHubsClientImpl(this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsClientImpl(this); + this.consumerGroups = new ConsumerGroupsClientImpl(this); + this.schemaRegistries = new SchemaRegistriesClientImpl(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..ce9eaa858522f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventHubsClientImpl.java @@ -0,0 +1,2362 @@ +// 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") + @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( + "/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("{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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, context).block(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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)); + } + + /** + * 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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/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..116c8993e8e14 --- /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 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 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 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); + } + + 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..970c4da3dff05 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/EventhubImpl.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.management.Region; +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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/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..db784e3519c63 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesClientImpl.java @@ -0,0 +1,3415 @@ +// 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.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetListResultInner; +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.RegenerateAccessKeyParameters; +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}/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}) + @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"}) + @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}/networkRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNetworkRuleSet( + @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> 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> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetWithResponseAsync( + 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 + .listNetworkRuleSet( + 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetWithResponseAsync( + 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 + .listNetworkRuleSet( + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listNetworkRuleSetAsync( + String resourceGroupName, String namespaceName) { + return listNetworkRuleSetWithResponseAsync(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 NetworkRuleSetListResultInner listNetworkRuleSet(String resourceGroupName, String namespaceName) { + return listNetworkRuleSetAsync(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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return listNetworkRuleSetWithResponseAsync(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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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..7b5b84b6cb574 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NamespacesImpl.java @@ -0,0 +1,513 @@ +// 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.NetworkRuleSetInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetListResultInner; +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.Namespaces; +import com.azure.resourcemanager.eventhubs.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.eventhubs.generated.models.NetworkRuleSetListResult; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; +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 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 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 NetworkRuleSetListResult listNetworkRuleSet(String resourceGroupName, String namespaceName) { + NetworkRuleSetListResultInner inner = this.serviceClient().listNetworkRuleSet(resourceGroupName, namespaceName); + if (inner != null) { + return new NetworkRuleSetListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + Response inner = + this.serviceClient().listNetworkRuleSetWithResponse(resourceGroupName, namespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkRuleSetListResultImpl(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 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 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); + } + + 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 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..de49e930b8339 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NetworkRuleSetImpl.java @@ -0,0 +1,86 @@ +// 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.SystemData; +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 com.azure.resourcemanager.eventhubs.generated.models.PublicNetworkAccessFlag; +import java.util.Collections; +import java.util.List; + +public final class NetworkRuleSetImpl implements NetworkRuleSet { + private NetworkRuleSetInner innerObject; + + private final com.azure.resourcemanager.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public Boolean trustedServiceAccessEnabled() { + return this.innerModel().trustedServiceAccessEnabled(); + } + + public DefaultAction defaultAction() { + return this.innerModel().defaultAction(); + } + + public List virtualNetworkRules() { + List inner = this.innerModel().virtualNetworkRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ipRules() { + List inner = this.innerModel().ipRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccessFlag publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public NetworkRuleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.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/NetworkRuleSetListResultImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NetworkRuleSetListResultImpl.java new file mode 100644 index 0000000000000..758a136c6695e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/NetworkRuleSetListResultImpl.java @@ -0,0 +1,52 @@ +// 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.fluent.models.NetworkRuleSetListResultInner; +import com.azure.resourcemanager.eventhubs.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.eventhubs.generated.models.NetworkRuleSetListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkRuleSetListResultImpl implements NetworkRuleSetListResult { + private NetworkRuleSetListResultInner innerObject; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + NetworkRuleSetListResultImpl( + NetworkRuleSetListResultInner 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 + .stream() + .map(inner1 -> new NetworkRuleSetImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public NetworkRuleSetListResultInner 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..0b769369514b1 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + 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..a86fd320ef93f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,273 @@ +// 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..40934efa4f585 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionImpl.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.management.Region; +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public ConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public EndPointProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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..cfb8aaf466e9f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1045 @@ +// 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..5ef533e6c7786 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,224 @@ +// 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @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/SchemaGroupImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaGroupImpl.java new file mode 100644 index 0000000000000..c69f1f5bc58e9 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaGroupImpl.java @@ -0,0 +1,198 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.SchemaGroupInner; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaCompatibility; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaGroup; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; +import java.util.UUID; + +public final class SchemaGroupImpl implements SchemaGroup, SchemaGroup.Definition, SchemaGroup.Update { + private SchemaGroupInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public OffsetDateTime updatedAtUtc() { + return this.innerModel().updatedAtUtc(); + } + + public OffsetDateTime createdAtUtc() { + return this.innerModel().createdAtUtc(); + } + + public UUID etag() { + return this.innerModel().etag(); + } + + public Map groupProperties() { + Map inner = this.innerModel().groupProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SchemaCompatibility schemaCompatibility() { + return this.innerModel().schemaCompatibility(); + } + + public SchemaType schemaType() { + return this.innerModel().schemaType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SchemaGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String schemaGroupName; + + public SchemaGroupImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SchemaGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getSchemaRegistries() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, schemaGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SchemaGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSchemaRegistries() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, schemaGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + SchemaGroupImpl(String name, com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerObject = new SchemaGroupInner(); + this.serviceManager = serviceManager; + this.schemaGroupName = name; + } + + public SchemaGroupImpl update() { + return this; + } + + public SchemaGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSchemaRegistries() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, schemaGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SchemaGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSchemaRegistries() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, schemaGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + SchemaGroupImpl( + SchemaGroupInner 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.schemaGroupName = Utils.getValueFromIdByName(innerObject.id(), "schemagroups"); + } + + public SchemaGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSchemaRegistries() + .getWithResponse(resourceGroupName, namespaceName, schemaGroupName, Context.NONE) + .getValue(); + return this; + } + + public SchemaGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSchemaRegistries() + .getWithResponse(resourceGroupName, namespaceName, schemaGroupName, context) + .getValue(); + return this; + } + + public SchemaGroupImpl withGroupProperties(Map groupProperties) { + this.innerModel().withGroupProperties(groupProperties); + return this; + } + + public SchemaGroupImpl withSchemaCompatibility(SchemaCompatibility schemaCompatibility) { + this.innerModel().withSchemaCompatibility(schemaCompatibility); + return this; + } + + public SchemaGroupImpl withSchemaType(SchemaType schemaType) { + this.innerModel().withSchemaType(schemaType); + return this; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaRegistriesClientImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaRegistriesClientImpl.java new file mode 100644 index 0000000000000..04cf96e410794 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaRegistriesClientImpl.java @@ -0,0 +1,928 @@ +// 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.SchemaRegistriesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.SchemaGroupInner; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaGroupListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SchemaRegistriesClient. */ +public final class SchemaRegistriesClientImpl implements SchemaRegistriesClient { + private final ClientLogger logger = new ClientLogger(SchemaRegistriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SchemaRegistriesService service; + + /** The service client containing this operation class. */ + private final EventHubManagementClientImpl client; + + /** + * Initializes an instance of SchemaRegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SchemaRegistriesClientImpl(EventHubManagementClientImpl client) { + this.service = + RestProxy.create(SchemaRegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventHubManagementClientSchemaRegistries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventHubManagementCl") + private interface SchemaRegistriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/schemagroups") + @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}/schemagroups/{schemaGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("schemaGroupName") String schemaGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SchemaGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces" + + "/{namespaceName}/schemagroups/{schemaGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("schemaGroupName") String schemaGroupName, + @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}/schemagroups/{schemaGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("schemaGroupName") String schemaGroupName, + @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> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the Schema Groups 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 Schema Groups in a Namespace along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 Schema Groups 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 Schema Groups in a Namespace along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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 Schema Groups 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)); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String schemaGroupName, SchemaGroupInner 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 (schemaGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter schemaGroupName 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, + schemaGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String schemaGroupName, + SchemaGroupInner 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 (schemaGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter schemaGroupName 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, + schemaGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String schemaGroupName, SchemaGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, schemaGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemaGroupInner createOrUpdate( + String resourceGroupName, String namespaceName, String schemaGroupName, SchemaGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, schemaGroupName, parameters).block(); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema Group 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 Schema Group operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String schemaGroupName, + SchemaGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, schemaGroupName, parameters, context) + .block(); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String schemaGroupName) { + 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 (schemaGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter schemaGroupName 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, + schemaGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String schemaGroupName, 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 (schemaGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter schemaGroupName 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, + schemaGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, String schemaGroupName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, schemaGroupName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 schemaGroupName) { + deleteAsync(resourceGroupName, namespaceName, schemaGroupName).block(); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, schemaGroupName, context).block(); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String schemaGroupName) { + 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 (schemaGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter schemaGroupName 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, + schemaGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String schemaGroupName, 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 (schemaGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter schemaGroupName 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, + schemaGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String schemaGroupName) { + return getWithResponseAsync(resourceGroupName, namespaceName, schemaGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemaGroupInner get(String resourceGroupName, String namespaceName, String schemaGroupName) { + return getAsync(resourceGroupName, namespaceName, schemaGroupName).block(); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, schemaGroupName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List SchemaGroup operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 SchemaGroup operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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/SchemaRegistriesImpl.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaRegistriesImpl.java new file mode 100644 index 0000000000000..1a1d532cfa8ae --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/implementation/SchemaRegistriesImpl.java @@ -0,0 +1,192 @@ +// 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.SchemaRegistriesClient; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.SchemaGroupInner; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaGroup; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaRegistries; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SchemaRegistriesImpl implements SchemaRegistries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaRegistriesImpl.class); + + private final SchemaRegistriesClient innerClient; + + private final com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager; + + public SchemaRegistriesImpl( + SchemaRegistriesClient innerClient, + com.azure.resourcemanager.eventhubs.generated.EventHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SchemaGroupImpl(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 SchemaGroupImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String schemaGroupName) { + this.serviceClient().delete(resourceGroupName, namespaceName, schemaGroupName); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, schemaGroupName, context); + } + + public SchemaGroup get(String resourceGroupName, String namespaceName, String schemaGroupName) { + SchemaGroupInner inner = this.serviceClient().get(resourceGroupName, namespaceName, schemaGroupName); + if (inner != null) { + return new SchemaGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, schemaGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SchemaGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SchemaGroup 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 schemaGroupName = Utils.getValueFromIdByName(id, "schemagroups"); + if (schemaGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemagroups'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, schemaGroupName, 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 schemaGroupName = Utils.getValueFromIdByName(id, "schemagroups"); + if (schemaGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemagroups'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, schemaGroupName, 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 schemaGroupName = Utils.getValueFromIdByName(id, "schemagroups"); + if (schemaGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemagroups'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, schemaGroupName, Context.NONE); + } + + 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 schemaGroupName = Utils.getValueFromIdByName(id, "schemagroups"); + if (schemaGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemagroups'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, schemaGroupName, context); + } + + private SchemaRegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager() { + return this.serviceManager; + } + + public SchemaGroupImpl define(String name) { + return new SchemaGroupImpl(name, this.manager()); + } +} 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/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..b5cda5a44398b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ArmDisasterRecovery.java @@ -0,0 +1,273 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * 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 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.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 {@link 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 {@link 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..d40c9a1cfc898 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/AuthorizationRule.java @@ -0,0 +1,224 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the rights property: The rights associated with the rule. + * + * @return the rights value. + */ + List rights(); + + /** + * 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.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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..51dee1e51e229 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Cluster.java @@ -0,0 +1,256 @@ +// 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.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..02184f1ed1d7b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Clusters.java @@ -0,0 +1,201 @@ +// 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 along with {@link Response}. + */ + Response listAvailableClusterRegionWithResponse(Context context); + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @throws com.azure.core.management.exception.ManagementException 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 list(); + + /** + * Lists the available Event Hubs Clusters within an ARM resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list(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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..5c8b521243b41 --- /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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..6265cd919b240 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ConsumerGroup.java @@ -0,0 +1,205 @@ +// 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.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * 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 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.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..fd640c3ca2f5e --- /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 {@link 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..006c2e2b5dd7f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Destination.java @@ -0,0 +1,214 @@ +// 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.DestinationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Capture storage details for capture description. */ +@Fluent +public final class Destination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Destination.class); + + /* + * Name for capture destination + */ + @JsonProperty(value = "name") + private String name; + + /* + * Properties describing the storage account, blob container and archive + * name format for capture destination + */ + @JsonProperty(value = "properties") + private DestinationProperties innerProperties; + + /** + * 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 innerProperties property: Properties describing the storage account, blob container and archive name + * format for capture destination. + * + * @return the innerProperties value. + */ + private DestinationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DestinationProperties(); + } + this.innerProperties().withStorageAccountResourceId(storageAccountResourceId); + return this; + } + + /** + * Get the blobContainer property: Blob container Name. + * + * @return the blobContainer value. + */ + public String blobContainer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DestinationProperties(); + } + this.innerProperties().withBlobContainer(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DestinationProperties(); + } + this.innerProperties().withArchiveNameFormat(archiveNameFormat); + return this; + } + + /** + * Get the dataLakeSubscriptionId property: Subscription Id of Azure Data Lake Store. + * + * @return the dataLakeSubscriptionId value. + */ + public UUID dataLakeSubscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().dataLakeSubscriptionId(); + } + + /** + * Set the dataLakeSubscriptionId property: Subscription Id of Azure Data Lake Store. + * + * @param dataLakeSubscriptionId the dataLakeSubscriptionId value to set. + * @return the Destination object itself. + */ + public Destination withDataLakeSubscriptionId(UUID dataLakeSubscriptionId) { + if (this.innerProperties() == null) { + this.innerProperties = new DestinationProperties(); + } + this.innerProperties().withDataLakeSubscriptionId(dataLakeSubscriptionId); + return this; + } + + /** + * Get the dataLakeAccountName property: The Azure Data Lake Store name for the captured events. + * + * @return the dataLakeAccountName value. + */ + public String dataLakeAccountName() { + return this.innerProperties() == null ? null : this.innerProperties().dataLakeAccountName(); + } + + /** + * Set the dataLakeAccountName property: The Azure Data Lake Store name for the captured events. + * + * @param dataLakeAccountName the dataLakeAccountName value to set. + * @return the Destination object itself. + */ + public Destination withDataLakeAccountName(String dataLakeAccountName) { + if (this.innerProperties() == null) { + this.innerProperties = new DestinationProperties(); + } + this.innerProperties().withDataLakeAccountName(dataLakeAccountName); + return this; + } + + /** + * Get the dataLakeFolderPath property: The destination folder path for the captured events. + * + * @return the dataLakeFolderPath value. + */ + public String dataLakeFolderPath() { + return this.innerProperties() == null ? null : this.innerProperties().dataLakeFolderPath(); + } + + /** + * Set the dataLakeFolderPath property: The destination folder path for the captured events. + * + * @param dataLakeFolderPath the dataLakeFolderPath value to set. + * @return the Destination object itself. + */ + public Destination withDataLakeFolderPath(String dataLakeFolderPath) { + if (this.innerProperties() == null) { + this.innerProperties = new DestinationProperties(); + } + this.innerProperties().withDataLakeFolderPath(dataLakeFolderPath); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..4853446e527ee --- /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 { + /** + * 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 along with {@link Response}. + */ + 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 {@link 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 along with {@link Response}. + */ + 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 {@link 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 {@link Response}. + */ + Response failOverWithResponse(String resourceGroupName, String namespaceName, String alias, 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 com.azure.core.management.exception.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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Alias(Disaster Recovery configuration) operation along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..cd532e200a657 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/EHNamespace.java @@ -0,0 +1,583 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.EHNamespaceInner; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.PrivateEndpointConnectionInner; +import java.time.OffsetDateTime; +import java.util.List; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Namespace. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: Status of the Namespace. + * + * @return the status value. + */ + String status(); + + /** + * Gets the createdAt property: The time the Namespace was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The time the Namespace was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * Gets the 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 privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the disableLocalAuth property: This property disables SAS authentication for the Event Hubs namespace. + * + * @return the disableLocalAuth value. + */ + Boolean disableLocalAuth(); + + /** + * Gets the alternateName property: Alternate name specified when alias and namespace names are same. + * + * @return the alternateName value. + */ + String alternateName(); + + /** + * 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, + DefinitionStages.WithPrivateEndpointConnections, + DefinitionStages.WithDisableLocalAuth, + DefinitionStages.WithAlternateName { + /** + * 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); + } + /** The stage of the EHNamespace definition allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the EHNamespace definition allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This property disables SAS authentication for the Event Hubs + * namespace.. + * + * @param disableLocalAuth This property disables SAS authentication for the Event Hubs namespace. + * @return the next definition stage. + */ + WithCreate withDisableLocalAuth(Boolean disableLocalAuth); + } + /** The stage of the EHNamespace 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 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, + UpdateStages.WithPrivateEndpointConnections, + UpdateStages.WithDisableLocalAuth, + UpdateStages.WithAlternateName { + /** + * 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); + } + /** The stage of the EHNamespace update allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + Update withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the EHNamespace update allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This property disables SAS authentication for the Event Hubs + * namespace.. + * + * @param disableLocalAuth This property disables SAS authentication for the Event Hubs namespace. + * @return the next definition stage. + */ + Update withDisableLocalAuth(Boolean disableLocalAuth); + } + /** The stage of the EHNamespace 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. + */ + 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..123817d5b8556 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Encryption.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /* + * Enable Infrastructure Encryption (Double Encryption) + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /** + * Get the keyVaultProperties property: Properties of KeyVault. + * + * @return the keyVaultProperties value. + */ + public List keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Properties of KeyVault. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(List keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the keySource property: Enumerates the possible value of keySource for Encryption. + * + * @return the keySource value. + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: Enumerates the possible value of keySource for Encryption. + * + * @param keySource the keySource value to set. + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: Enable Infrastructure Encryption (Double Encryption). + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: Enable Infrastructure Encryption (Double Encryption). + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/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..364fcb5c0eaa7 --- /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 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 {@link 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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String eventHubName, 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 com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String eventHubName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..c6e2ce2adb474 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Eventhub.java @@ -0,0 +1,301 @@ +// 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.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * 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 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.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..db9e91ab917b7 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Identity.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** 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", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * TenantId from the KeyVault + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Type of managed service identity. + */ + @JsonProperty(value = "type") + private ManagedServiceIdentityType type; + + /* + * Properties for User Assigned Identities + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: ObjectId from the KeyVault. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: TenantId from the KeyVault. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Properties for User Assigned Identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Properties for User Assigned Identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/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..4328923b7d8d4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyType.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 KeyType. */ +public final class KeyType extends ExpandableStringEnum { + /** Static value PrimaryKey for KeyType. */ + public static final KeyType PRIMARY_KEY = fromString("PrimaryKey"); + + /** Static value SecondaryKey for KeyType. */ + public static final KeyType SECONDARY_KEY = fromString("SecondaryKey"); + + /** + * Creates or finds a KeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyType. + */ + @JsonCreator + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** @return known KeyType values. */ + public static Collection values() { + return values(KeyType.class); + } +} 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..36f6122eeef81 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/KeyVaultProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private UserAssignedIdentityProperties identity; + + /** + * Get the keyName property: Name of the Key from KeyVault. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Name of the Key from KeyVault. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVaultUri property: Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the keyVersion property: 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; + } + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public UserAssignedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentity(UserAssignedIdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ManagedServiceIdentityType.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..6e7d507106c08 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/ManagedServiceIdentityType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ManagedServiceIdentityType. */ +public enum ManagedServiceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ManagedServiceIdentityType instance. */ + private final String value; + + ManagedServiceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ManagedServiceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ManagedServiceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String value) { + ManagedServiceIdentityType[] items = ManagedServiceIdentityType.values(); + for (ManagedServiceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/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..42393360f56f3 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Namespaces.java @@ -0,0 +1,463 @@ +// 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 { + /** + * 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, 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. + */ + NetworkRuleSetListResult listNetworkRuleSet(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 along with {@link Response}. + */ + Response listNetworkRuleSetWithResponse( + 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 {@link 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + Response getByIdWithResponse(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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 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 {@link 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 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..8d8773b6515b3 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleSet.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.models; + +import com.azure.core.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + Boolean trustedServiceAccessEnabled(); + + /** + * Gets the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + DefaultAction defaultAction(); + + /** + * Gets the virtualNetworkRules property: List VirtualNetwork Rules. + * + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + + /** + * Gets the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + List ipRules(); + + /** + * Gets the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it + * is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccessFlag publicNetworkAccess(); + + /** + * Gets the inner com.azure.resourcemanager.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/NetworkRuleSetListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleSetListResult.java new file mode 100644 index 0000000000000..52418b88b5fe8 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/NetworkRuleSetListResult.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.NetworkRuleSetListResultInner; +import java.util.List; + +/** An immutable client-side representation of NetworkRuleSetListResult. */ +public interface NetworkRuleSetListResult { + /** + * Gets the value property: Result of the List NetworkRuleSet operation. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.eventhubs.generated.fluent.models.NetworkRuleSetListResultInner object. + * + * @return the inner object. + */ + NetworkRuleSetListResultInner 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..fec343a282033 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Operation.java @@ -0,0 +1,52 @@ +// 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 isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + Object properties(); + + /** + * 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..ff7d279ab5f91 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/OperationDisplay.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Resource provider of the operation + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Resource of the operation + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * 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..9c90b1aff826d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,241 @@ +// 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.management.SystemData; +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * 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 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.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..69981b99f7d03 --- /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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..8109805fd5d4a --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PrivateLinkResource.java @@ -0,0 +1,191 @@ +// 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.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information of the private link resource. */ +@Fluent +public final class PrivateLinkResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); + + /* + * Properties of the private link resource. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Fully qualified identifier of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the resource + */ + @JsonProperty(value = "name") + private String name; + + /* + * Type of the resource + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the innerProperties property: Properties of the private link resource. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredMembers(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..d35ffc6cca689 --- /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 along with {@link Response}. + */ + 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/PublicNetworkAccessFlag.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PublicNetworkAccessFlag.java new file mode 100644 index 0000000000000..4d988a8ab66ff --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/PublicNetworkAccessFlag.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccessFlag. */ +public final class PublicNetworkAccessFlag extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccessFlag. */ + public static final PublicNetworkAccessFlag ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccessFlag. */ + public static final PublicNetworkAccessFlag DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccessFlag from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccessFlag. + */ + @JsonCreator + public static PublicNetworkAccessFlag fromString(String name) { + return fromString(name, PublicNetworkAccessFlag.class); + } + + /** @return known PublicNetworkAccessFlag values. */ + public static Collection values() { + return values(PublicNetworkAccessFlag.class); + } +} diff --git a/sdk/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/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/SchemaCompatibility.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaCompatibility.java new file mode 100644 index 0000000000000..64ede69cce9cb --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaCompatibility.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 SchemaCompatibility. */ +public final class SchemaCompatibility extends ExpandableStringEnum { + /** Static value None for SchemaCompatibility. */ + public static final SchemaCompatibility NONE = fromString("None"); + + /** Static value Backward for SchemaCompatibility. */ + public static final SchemaCompatibility BACKWARD = fromString("Backward"); + + /** Static value Forward for SchemaCompatibility. */ + public static final SchemaCompatibility FORWARD = fromString("Forward"); + + /** + * Creates or finds a SchemaCompatibility from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaCompatibility. + */ + @JsonCreator + public static SchemaCompatibility fromString(String name) { + return fromString(name, SchemaCompatibility.class); + } + + /** @return known SchemaCompatibility values. */ + public static Collection values() { + return values(SchemaCompatibility.class); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaGroup.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaGroup.java new file mode 100644 index 0000000000000..3fee3a9834a78 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaGroup.java @@ -0,0 +1,261 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.SchemaGroupInner; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** An immutable client-side representation of SchemaGroup. */ +public interface SchemaGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the updatedAtUtc property: Exact time the Schema Group was updated. + * + * @return the updatedAtUtc value. + */ + OffsetDateTime updatedAtUtc(); + + /** + * Gets the createdAtUtc property: Exact time the Schema Group was created. + * + * @return the createdAtUtc value. + */ + OffsetDateTime createdAtUtc(); + + /** + * Gets the etag property: The ETag value. + * + * @return the etag value. + */ + UUID etag(); + + /** + * Gets the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @return the groupProperties value. + */ + Map groupProperties(); + + /** + * Gets the schemaCompatibility property: The schemaCompatibility property. + * + * @return the schemaCompatibility value. + */ + SchemaCompatibility schemaCompatibility(); + + /** + * Gets the schemaType property: The schemaType property. + * + * @return the schemaType value. + */ + SchemaType schemaType(); + + /** + * 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.SchemaGroupInner object. + * + * @return the inner object. + */ + SchemaGroupInner innerModel(); + + /** The entirety of the SchemaGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SchemaGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the SchemaGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SchemaGroup 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 SchemaGroup 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.WithGroupProperties, + DefinitionStages.WithSchemaCompatibility, + DefinitionStages.WithSchemaType { + /** + * Executes the create request. + * + * @return the created resource. + */ + SchemaGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SchemaGroup create(Context context); + } + /** The stage of the SchemaGroup definition allowing to specify groupProperties. */ + interface WithGroupProperties { + /** + * Specifies the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @param groupProperties dictionary object for SchemaGroup group properties. + * @return the next definition stage. + */ + WithCreate withGroupProperties(Map groupProperties); + } + /** The stage of the SchemaGroup definition allowing to specify schemaCompatibility. */ + interface WithSchemaCompatibility { + /** + * Specifies the schemaCompatibility property: The schemaCompatibility property.. + * + * @param schemaCompatibility The schemaCompatibility property. + * @return the next definition stage. + */ + WithCreate withSchemaCompatibility(SchemaCompatibility schemaCompatibility); + } + /** The stage of the SchemaGroup definition allowing to specify schemaType. */ + interface WithSchemaType { + /** + * Specifies the schemaType property: The schemaType property.. + * + * @param schemaType The schemaType property. + * @return the next definition stage. + */ + WithCreate withSchemaType(SchemaType schemaType); + } + } + /** + * Begins update for the SchemaGroup resource. + * + * @return the stage of resource update. + */ + SchemaGroup.Update update(); + + /** The template for SchemaGroup update. */ + interface Update + extends UpdateStages.WithGroupProperties, UpdateStages.WithSchemaCompatibility, UpdateStages.WithSchemaType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SchemaGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SchemaGroup apply(Context context); + } + /** The SchemaGroup update stages. */ + interface UpdateStages { + /** The stage of the SchemaGroup update allowing to specify groupProperties. */ + interface WithGroupProperties { + /** + * Specifies the groupProperties property: dictionary object for SchemaGroup group properties. + * + * @param groupProperties dictionary object for SchemaGroup group properties. + * @return the next definition stage. + */ + Update withGroupProperties(Map groupProperties); + } + /** The stage of the SchemaGroup update allowing to specify schemaCompatibility. */ + interface WithSchemaCompatibility { + /** + * Specifies the schemaCompatibility property: The schemaCompatibility property.. + * + * @param schemaCompatibility The schemaCompatibility property. + * @return the next definition stage. + */ + Update withSchemaCompatibility(SchemaCompatibility schemaCompatibility); + } + /** The stage of the SchemaGroup update allowing to specify schemaType. */ + interface WithSchemaType { + /** + * Specifies the schemaType property: The schemaType property.. + * + * @param schemaType The schemaType property. + * @return the next definition stage. + */ + Update withSchemaType(SchemaType schemaType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SchemaGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SchemaGroup refresh(Context context); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaGroupListResult.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaGroupListResult.java new file mode 100644 index 0000000000000..ce21d8fa5822b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaGroupListResult.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.SchemaGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the List SchemaGroup operation. */ +@Fluent +public final class SchemaGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaGroupListResult.class); + + /* + * Result of the List SchemaGroups operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of Schema Groups. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List SchemaGroups operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List SchemaGroups operation. + * + * @param value the value value to set. + * @return the SchemaGroupListResult object itself. + */ + public SchemaGroupListResult 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 Schema + * Groups. + * + * @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 Schema + * Groups. + * + * @param nextLink the nextLink value to set. + * @return the SchemaGroupListResult object itself. + */ + public SchemaGroupListResult 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/SchemaRegistries.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaRegistries.java new file mode 100644 index 0000000000000..cc4385a8efa15 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaRegistries.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.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 SchemaRegistries. */ +public interface SchemaRegistries { + /** + * Gets all the Schema Groups 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 Schema Groups in a Namespace. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets all the Schema Groups 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 Schema Groups in a Namespace. + */ + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 schemaGroupName); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation. + */ + SchemaGroup get(String resourceGroupName, String namespaceName, String schemaGroupName); + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name. + * @param schemaGroupName The Schema 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 single item in List or Get Schema Group operation along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String schemaGroupName, Context context); + + /** + * @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 Schema Group operation along with {@link Response}. + */ + SchemaGroup getById(String id); + + /** + * @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 Schema Group operation along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * @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); + + /** + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SchemaGroup resource. + * + * @param name resource name. + * @return the first stage of the new SchemaGroup definition. + */ + SchemaGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaType.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaType.java new file mode 100644 index 0000000000000..2d6ab6727cc25 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SchemaType.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 SchemaType. */ +public final class SchemaType extends ExpandableStringEnum { + /** Static value Unknown for SchemaType. */ + public static final SchemaType UNKNOWN = fromString("Unknown"); + + /** Static value Avro for SchemaType. */ + public static final SchemaType AVRO = fromString("Avro"); + + /** + * Creates or finds a SchemaType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaType. + */ + @JsonCreator + public static SchemaType fromString(String name) { + return fromString(name, SchemaType.class); + } + + /** @return known SchemaType values. */ + public static Collection values() { + return values(SchemaType.class); + } +} 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..0e2160d45287e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/Sku.java @@ -0,0 +1,112 @@ +// 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 for Basic or Standard tiers, where value + * should be 0 to 20 throughput units. The Event Hubs premium units for + * Premium tier, where value should be 0 to 10 premium 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 for Basic or Standard tiers, where value should be 0 + * to 20 throughput units. The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium + * units. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 + * to 20 throughput units. The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium + * 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..95739fdcc5869 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuName.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 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"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * 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..5a056016f69f5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/SkuTier.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 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"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * 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/UserAssignedIdentity.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..f10233758098d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UserAssignedIdentity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** Recognized Dictionary value. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * Principal Id of user assigned identity + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * Client Id of user assigned identity + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: Principal Id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: Client Id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UserAssignedIdentityProperties.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UserAssignedIdentityProperties.java new file mode 100644 index 0000000000000..b381eab998dae --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/main/java/com/azure/resourcemanager/eventhubs/generated/models/UserAssignedIdentityProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 UserAssignedIdentityProperties model. */ +@Fluent +public final class UserAssignedIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentityProperties.class); + + /* + * ARM ID of user Identity selected for encryption + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /** + * Get the userAssignedIdentity property: ARM ID of user Identity selected for encryption. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: ARM ID of user Identity selected for encryption. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the UserAssignedIdentityProperties object itself. + */ + public UserAssignedIdentityProperties withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/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/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2565db985f908 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// 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.generated; + +import com.azure.resourcemanager.eventhubs.generated.models.ClusterSku; +import com.azure.resourcemanager.eventhubs.generated.models.ClusterSkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters CreateOrUpdate. */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPut.json + */ + /** + * Sample code: ClusterPut. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterPut(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .clusters() + .define("testCluster") + .withRegion("South Central US") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSku(new ClusterSku().withName(ClusterSkuName.DEDICATED).withCapacity(1)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersDeleteSamples.java new file mode 100644 index 0000000000000..c1d654da8c258 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterDelete.json + */ + /** + * Sample code: ClusterDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().delete("myResourceGroup", "testCluster", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersGetByResourceGroupSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..eb256ba5c8820 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterGet.json + */ + /** + * Sample code: ClusterGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().getByResourceGroupWithResponse("myResourceGroup", "testCluster", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListAvailableClusterRegionSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListAvailableClusterRegionSamples.java new file mode 100644 index 0000000000000..e4c1889f55991 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListAvailableClusterRegionSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters ListAvailableClusterRegion. */ +public final class ClustersListAvailableClusterRegionSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListAvailableClustersGet.json + */ + /** + * Sample code: ListAvailableClusters. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listAvailableClusters(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().listAvailableClusterRegionWithResponse(Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListByResourceGroupSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..5b4cd2f615203 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListByResourceGroup.json + */ + /** + * Sample code: ClustersListByResourceGroup. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersListByResourceGroup( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListNamespacesSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListNamespacesSamples.java new file mode 100644 index 0000000000000..4a7ddf98b115d --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListNamespacesSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters ListNamespaces. */ +public final class ClustersListNamespacesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListNamespacesInClusterGet.json + */ + /** + * Sample code: ListNamespacesInCluster. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listNamespacesInCluster(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().listNamespacesWithResponse("myResourceGroup", "testCluster", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListSamples.java new file mode 100644 index 0000000000000..e827e4f160651 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListBySubscription.json + */ + /** + * Sample code: ClustersListBySubscription. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersListBySubscription( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.clusters().list(Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersUpdateSamples.java new file mode 100644 index 0000000000000..6743508e072f4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ClustersUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.Cluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPatch.json + */ + /** + * Sample code: ClusterPatch. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clusterPatch(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("myResourceGroup", "testCluster", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag3", "value3", "tag4", "value4")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConfigurationGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConfigurationGetSamples.java new file mode 100644 index 0000000000000..1e75dbc34c442 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConfigurationGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Configuration Get. */ +public final class ConfigurationGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationGet.json + */ + /** + * Sample code: ClustersQuotasConfigurationGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersQuotasConfigurationGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.configurations().getWithResponse("myResourceGroup", "testCluster", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConfigurationPatchSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConfigurationPatchSamples.java new file mode 100644 index 0000000000000..13cbec5801f2f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConfigurationPatchSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.ClusterQuotaConfigurationPropertiesInner; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Configuration Patch. */ +public final class ConfigurationPatchSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationPatch.json + */ + /** + * Sample code: ClustersQuotasConfigurationPatch. + * + * @param manager Entry point to EventHubsManager. + */ + public static void clustersQuotasConfigurationPatch( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .configurations() + .patchWithResponse( + "ArunMonocle", + "testCluster", + new ClusterQuotaConfigurationPropertiesInner() + .withSettings(mapOf("eventhub-per-namespace-quota", "20", "namespaces-per-cluster-quota", "200")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..21b92bbfd805f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsCreateOrUpdateSamples.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.generated; + +/** Samples for ConsumerGroups CreateOrUpdate. */ +public final class ConsumerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupCreate.json + */ + /** + * Sample code: ConsumerGroupCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .define("sdk-ConsumerGroup-5563") + .withExistingEventhub("ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681") + .withUserMetadata("New consumergroup") + .create(); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsDeleteSamples.java new file mode 100644 index 0000000000000..88d819743a50c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ConsumerGroups Delete. */ +public final class ConsumerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupDelete.json + */ + /** + * Sample code: ConsumerGroupDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .deleteWithResponse( + "ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", "sdk-ConsumerGroup-5563", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsGetSamples.java new file mode 100644 index 0000000000000..f388c781f4369 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ConsumerGroups Get. */ +public final class ConsumerGroupsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupGet.json + */ + /** + * Sample code: ConsumerGroupGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .getWithResponse( + "ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", "sdk-ConsumerGroup-5563", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsListByEventHubSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsListByEventHubSamples.java new file mode 100644 index 0000000000000..f34cc55c0283c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/ConsumerGroupsListByEventHubSamples.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ConsumerGroups ListByEventHub. */ +public final class ConsumerGroupsListByEventHubSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupListByEventHub.json + */ + /** + * Sample code: ConsumerGroupsListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void consumerGroupsListAll(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .consumerGroups() + .listByEventHub("ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", null, null, Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsBreakPairingSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsBreakPairingSamples.java new file mode 100644 index 0000000000000..3784fc1bf358f --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsBreakPairingSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs BreakPairing. */ +public final class DisasterRecoveryConfigsBreakPairingSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasBreakPairing.json + */ + /** + * Sample code: EHAliasBreakPairing. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasBreakPairing(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .breakPairingWithResponse( + "exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..f76d255cbfdd5 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; + +/** Samples for DisasterRecoveryConfigs CheckNameAvailability. */ +public final class DisasterRecoveryConfigsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCheckNameAvailability.json + */ + /** + * Sample code: NamespacesCheckNameAvailability. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesCheckNameAvailability( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .checkNameAvailabilityWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + new CheckNameAvailabilityParameter().withName("sdk-DisasterRecovery-9474"), + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..eeba526d1d953 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.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.generated; + +/** Samples for DisasterRecoveryConfigs CreateOrUpdate. */ +public final class DisasterRecoveryConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCreate.json + */ + /** + * Sample code: EHAliasCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .define("sdk-DisasterRecovery-3814") + .withExistingNamespace("exampleResourceGroup", "sdk-Namespace-8859") + .withPartnerNamespace("sdk-Namespace-37") + .create(); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsDeleteSamples.java new file mode 100644 index 0000000000000..951d9f04033ec --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Delete. */ +public final class DisasterRecoveryConfigsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasDelete.json + */ + /** + * Sample code: EHAliasDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .deleteWithResponse( + "exampleResourceGroup", "sdk-Namespace-5849", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsFailOverSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsFailOverSamples.java new file mode 100644 index 0000000000000..380a5e078784c --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsFailOverSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs FailOver. */ +public final class DisasterRecoveryConfigsFailOverSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasFailOver.json + */ + /** + * Sample code: EHAliasFailOver. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasFailOver(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .failOverWithResponse( + "exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..c571772d52dae --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs GetAuthorizationRule. */ +public final class DisasterRecoveryConfigsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleGet.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .getAuthorizationRuleWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + "sdk-DisasterRecovery-4879", + "sdk-Authrules-4879", + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsGetSamples.java new file mode 100644 index 0000000000000..0cb92c53dc471 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsGetSamples.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Get. */ +public final class DisasterRecoveryConfigsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasGet.json + */ + /** + * Sample code: EHAliasGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .getWithResponse("exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java new file mode 100644 index 0000000000000..195dc8893a712 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListAuthorizationRules. */ +public final class DisasterRecoveryConfigsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListAll.json + */ + /** + * Sample code: ListAuthorizationRules. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listAuthorizationRules(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .listAuthorizationRules( + "exampleResourceGroup", "sdk-Namespace-9080", "sdk-DisasterRecovery-4047", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListKeysSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListKeysSamples.java new file mode 100644 index 0000000000000..d13966ee48c2b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListKeysSamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListKeys. */ +public final class DisasterRecoveryConfigsListKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleListKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .disasterRecoveryConfigs() + .listKeysWithResponse( + "exampleResourceGroup", + "sdk-Namespace-2702", + "sdk-DisasterRecovery-4047", + "sdk-Authrules-1746", + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListSamples.java new file mode 100644 index 0000000000000..53f5a34b57750 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/DisasterRecoveryConfigsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs List. */ +public final class DisasterRecoveryConfigsListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasList.json + */ + /** + * Sample code: EHAliasList. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHAliasList(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.disasterRecoveryConfigs().list("exampleResourceGroup", "sdk-Namespace-8859", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsCreateOrUpdateAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsCreateOrUpdateAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..9354727f72b65 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsCreateOrUpdateAuthorizationRuleSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.eventhubs.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for EventHubs CreateOrUpdateAuthorizationRule. */ +public final class EventHubsCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleCreate.json + */ + /** + * Sample code: EventHubAuthorizationRuleCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .createOrUpdateAuthorizationRuleWithResponse( + "ArunMonocle", + "sdk-Namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-2513", + new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..68192a30a29a8 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.eventhubs.generated.models.CaptureDescription; +import com.azure.resourcemanager.eventhubs.generated.models.Destination; +import com.azure.resourcemanager.eventhubs.generated.models.EncodingCaptureDescription; +import com.azure.resourcemanager.eventhubs.generated.models.EntityStatus; + +/** Samples for EventHubs CreateOrUpdate. */ +public final class EventHubsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubCreate.json + */ + /** + * Sample code: EventHubCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .define("sdk-EventHub-6547") + .withExistingNamespace("Default-NotificationHubs-AustraliaEast", "sdk-Namespace-5357") + .withMessageRetentionInDays(4L) + .withPartitionCount(4L) + .withStatus(EntityStatus.ACTIVE) + .withCaptureDescription( + new CaptureDescription() + .withEnabled(true) + .withEncoding(EncodingCaptureDescription.AVRO) + .withIntervalInSeconds(120) + .withSizeLimitInBytes(10485763) + .withDestination( + new Destination() + .withName("EventHubArchive.AzureBlockBlob") + .withStorageAccountResourceId( + "/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage") + .withBlobContainer("container") + .withArchiveNameFormat( + "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"))) + .create(); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsDeleteAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsDeleteAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..a7ec488600235 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsDeleteAuthorizationRuleSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs DeleteAuthorizationRule. */ +public final class EventHubsDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleDelete.json + */ + /** + * Sample code: EventHubAuthorizationRuleDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleDelete( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsDeleteSamples.java new file mode 100644 index 0000000000000..23664cf156e38 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs Delete. */ +public final class EventHubsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubDelete.json + */ + /** + * Sample code: EventHubDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.eventHubs().deleteWithResponse("ArunMonocle", "sdk-Namespace-5357", "sdk-EventHub-6547", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsGetAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsGetAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..3bc6cb0856618 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsGetAuthorizationRuleSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs GetAuthorizationRule. */ +public final class EventHubsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleGet.json + */ + /** + * Sample code: EventHubAuthorizationRuleGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .getAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsGetSamples.java new file mode 100644 index 0000000000000..710da61540e42 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs Get. */ +public final class EventHubsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubGet.json + */ + /** + * Sample code: EventHubGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .getWithResponse( + "Default-NotificationHubs-AustraliaEast", "sdk-Namespace-716", "sdk-EventHub-10", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListAuthorizationRulesSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListAuthorizationRulesSamples.java new file mode 100644 index 0000000000000..014d97b6d851e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListAuthorizationRulesSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs ListAuthorizationRules. */ +public final class EventHubsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListAll.json + */ + /** + * Sample code: EventHubAuthorizationRuleListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleListAll( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .listAuthorizationRules("ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListByNamespaceSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListByNamespaceSamples.java new file mode 100644 index 0000000000000..0cbadf8eaa705 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListByNamespaceSamples.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs ListByNamespace. */ +public final class EventHubsListByNamespaceSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubListByNameSpace.json + */ + /** + * Sample code: EventHubsListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubsListAll(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .listByNamespace("Default-NotificationHubs-AustraliaEast", "sdk-Namespace-5357", null, null, Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListKeysSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListKeysSamples.java new file mode 100644 index 0000000000000..b98bec83a34d9 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsListKeysSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for EventHubs ListKeys. */ +public final class EventHubsListKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListKey.json + */ + /** + * Sample code: EventHubAuthorizationRuleListKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleListKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .listKeysWithResponse( + "ArunMonocle", "sdk-namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsRegenerateKeysSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsRegenerateKeysSamples.java new file mode 100644 index 0000000000000..9655bc40468cc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/EventHubsRegenerateKeysSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.KeyType; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; + +/** Samples for EventHubs RegenerateKeys. */ +public final class EventHubsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: EventHubAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eventHubAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .eventHubs() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-1534", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCheckNameAvailabilitySamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..7a0fb89c70a4e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCheckNameAvailabilitySamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.CheckNameAvailabilityParameter; + +/** Samples for Namespaces CheckNameAvailability. */ +public final class NamespacesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json + */ + /** + * Sample code: NamespacesCheckNameAvailability. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesCheckNameAvailability( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameter().withName("sdk-Namespace-8458"), Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..759888a054da2 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.resourcemanager.eventhubs.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ +public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleCreate.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .defineAuthorizationRule("sdk-Authrules-1746") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-2702") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) + .create(); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java new file mode 100644 index 0000000000000..9bbdf765003c0 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java @@ -0,0 +1,66 @@ +// 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.generated; + +import com.azure.core.util.Context; +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.NetworkRuleIpAction; +import com.azure.resourcemanager.eventhubs.generated.models.Subnet; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateNetworkRuleSet. */ +public final class NamespacesCreateOrUpdateNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetCreate.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceNetworkRuleSetCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .createOrUpdateNetworkRuleSetWithResponse( + "ResourceGroup", + "sdk-Namespace-6019", + new NetworkRuleSetInner() + .withDefaultAction(DefaultAction.DENY) + .withVirtualNetworkRules( + Arrays + .asList( + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2")) + .withIgnoreMissingVnetServiceEndpoint(true), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3")) + .withIgnoreMissingVnetServiceEndpoint(false), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6")) + .withIgnoreMissingVnetServiceEndpoint(false))) + .withIpRules( + Arrays + .asList( + new NWRuleSetIpRules().withIpMask("1.1.1.1").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.2").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.3").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.4").withAction(NetworkRuleIpAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.5").withAction(NetworkRuleIpAction.ALLOW))), + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3d25627bec972 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesCreateOrUpdateSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventhubs.generated.generated; + +import com.azure.resourcemanager.eventhubs.generated.models.Encryption; +import com.azure.resourcemanager.eventhubs.generated.models.Identity; +import com.azure.resourcemanager.eventhubs.generated.models.KeySource; +import com.azure.resourcemanager.eventhubs.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.eventhubs.generated.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.eventhubs.generated.models.UserAssignedIdentity; +import com.azure.resourcemanager.eventhubs.generated.models.UserAssignedIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces CreateOrUpdate. */ +public final class NamespacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCreate.json + */ + /** + * Sample code: NamespaceCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespaceCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .define("NamespaceSample") + .withRegion("East US") + .withExistingResourceGroup("ResurceGroupSample") + .withIdentity( + new Identity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1", + new UserAssignedIdentity(), + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2", + new UserAssignedIdentity()))) + .withClusterArmId( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/clusters/enc-test") + .withEncryption( + new Encryption() + .withKeyVaultProperties( + Arrays + .asList( + new KeyVaultProperties() + .withKeyName("Samplekey") + .withKeyVaultUri("https://aprao-keyvault-user.vault-int.azure-int.net/") + .withIdentity( + new UserAssignedIdentityProperties() + .withUserAssignedIdentity( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1")))) + .withKeySource(KeySource.MICROSOFT_KEY_VAULT)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesDeleteAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesDeleteAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..99eef7a45ef18 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesDeleteAuthorizationRuleSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces DeleteAuthorizationRule. */ +public final class NamespacesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleDelete.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleDelete( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-8980", "sdk-Authrules-8929", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesDeleteSamples.java new file mode 100644 index 0000000000000..c94938e141de8 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces Delete. */ +public final class NamespacesDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceDelete.json + */ + /** + * Sample code: NameSpaceDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().delete("ResurceGroupSample", "NamespaceSample", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetAuthorizationRuleSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetAuthorizationRuleSamples.java new file mode 100644 index 0000000000000..a7188c0f8f339 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetAuthorizationRuleSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetAuthorizationRule. */ +public final class NamespacesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleGet.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .getAuthorizationRuleWithResponse("ArunMonocle", "sdk-Namespace-2702", "sdk-Authrules-1746", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetByResourceGroupSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d1e6b92d0eb41 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetByResourceGroup. */ +public final class NamespacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceGet.json + */ + /** + * Sample code: NameSpaceGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().getByResourceGroupWithResponse("ResurceGroupSample", "NamespaceSample", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetNetworkRuleSetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetNetworkRuleSetSamples.java new file mode 100644 index 0000000000000..0f8f59dd77d42 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesGetNetworkRuleSetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetNetworkRuleSet. */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetGet.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceNetworkRuleSetGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().getNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListAuthorizationRulesSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListAuthorizationRulesSamples.java new file mode 100644 index 0000000000000..54cd49dd6fb4e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListAuthorizationRulesSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListAuthorizationRules. */ +public final class NamespacesListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json + */ + /** + * Sample code: ListAuthorizationRules. + * + * @param manager Entry point to EventHubsManager. + */ + public static void listAuthorizationRules(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().listAuthorizationRules("ArunMonocle", "sdk-Namespace-2702", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListByResourceGroupSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..89c32ae7c40b4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListByResourceGroup. */ +public final class NamespacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceListByResourceGroup.json + */ + /** + * Sample code: NamespaceListByResourceGroup. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespaceListByResourceGroup( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().listByResourceGroup("ResurceGroupSample", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListKeysSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListKeysSamples.java new file mode 100644 index 0000000000000..2b7ae1a501254 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListKeysSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListKeys. */ +public final class NamespacesListKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleListKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .listKeysWithResponse("ArunMonocle", "sdk-Namespace-2702", "sdk-Authrules-1746", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListNetworkRuleSetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListNetworkRuleSetSamples.java new file mode 100644 index 0000000000000..4483e5a9b3c3e --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListNetworkRuleSetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListNetworkRuleSet. */ +public final class NamespacesListNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetList.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetList. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceNetworkRuleSetList( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().listNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListSamples.java new file mode 100644 index 0000000000000..824172728ba84 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces List. */ +public final class NamespacesListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceList.json + */ + /** + * Sample code: NamespacesListBySubscription. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesListBySubscription( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.namespaces().list(Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesRegenerateKeysSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesRegenerateKeysSamples.java new file mode 100644 index 0000000000000..a4cd905d5e3b4 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesRegenerateKeysSamples.java @@ -0,0 +1,32 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.KeyType; +import com.azure.resourcemanager.eventhubs.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Namespaces RegenerateKeys. */ +public final class NamespacesRegenerateKeysSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .namespaces() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-Namespace-8980", + "sdk-Authrules-8929", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesUpdateSamples.java new file mode 100644 index 0000000000000..fae76b8435caf --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/NamespacesUpdateSamples.java @@ -0,0 +1,52 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventhubs.generated.models.EHNamespace; +import com.azure.resourcemanager.eventhubs.generated.models.Identity; +import com.azure.resourcemanager.eventhubs.generated.models.ManagedServiceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces Update. */ +public final class NamespacesUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceUpdate.json + */ + /** + * Sample code: NamespacesUpdate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void namespacesUpdate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + EHNamespace resource = + manager + .namespaces() + .getByResourceGroupWithResponse("ResurceGroupSample", "NamespaceSample", Context.NONE) + .getValue(); + resource + .update() + .withIdentity( + new Identity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2", + null))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/OperationsListSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..933c1e83ce72b --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EHOperations_List.json + */ + /** + * Sample code: EHOperations_List. + * + * @param manager Entry point to EventHubsManager. + */ + public static void eHOperationsList(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bbf4fadc70815 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.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.generated; + +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.PrivateLinkConnectionStatus; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateEndPointConnectionCreate( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .privateEndpointConnections() + .define("privateEndpointConnectionName") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-2924") + .withPrivateEndpoint( + new PrivateEndpoint() + .withId( + "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-EventHub-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.REJECTED).withDescription("testing")) + .withProvisioningState(EndPointProvisioningState.SUCCEEDED) + .create(); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..58520b5680148 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateEndPointConnectionDelete( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .privateEndpointConnections() + .delete("ArunMonocle", "sdk-Namespace-3285", "928c44d5-b7c6-423b-b6fa-811e0c27b3e0", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..a125d93712324 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateEndPointConnectionGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("SDK-EventHub-4794", "sdk-Namespace-5828", "privateEndpointConnectionName", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..27a9e72ca9399 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json + */ + /** + * Sample code: NameSpaceCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpaceCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.privateEndpointConnections().list("SDK-EventHub-4794", "sdk-Namespace-5828", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateLinkResourcesGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 0000000000000..fa3cb8874d910 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateLinkResourcesGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void nameSpacePrivateLinkResourcesGet( + com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.privateLinkResources().getWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryCreateOrUpdateSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a11d071b18ecc --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// 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.generated; + +import com.azure.resourcemanager.eventhubs.generated.models.SchemaCompatibility; +import com.azure.resourcemanager.eventhubs.generated.models.SchemaType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SchemaRegistry CreateOrUpdate. */ +public final class SchemaRegistryCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryCreate.json + */ + /** + * Sample code: SchemaRegistryCreate. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryCreate(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .schemaRegistries() + .define("testSchemaGroup1") + .withExistingNamespace("alitest", "ali-ua-test-eh-system-1") + .withGroupProperties(mapOf()) + .withSchemaCompatibility(SchemaCompatibility.FORWARD) + .withSchemaType(SchemaType.AVRO) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryDeleteSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryDeleteSamples.java new file mode 100644 index 0000000000000..370589171aaba --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryDeleteSamples.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for SchemaRegistry Delete. */ +public final class SchemaRegistryDeleteSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryDelete.json + */ + /** + * Sample code: SchemaRegistryDelete. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryDelete(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .schemaRegistries() + .deleteWithResponse("alitest", "ali-ua-test-eh-system-1", "testSchemaGroup1", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryGetSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryGetSamples.java new file mode 100644 index 0000000000000..e03aa13a12851 --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryGetSamples.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for SchemaRegistry Get. */ +public final class SchemaRegistryGetSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryGet.json + */ + /** + * Sample code: SchemaRegistryGet. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryGet(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager + .schemaRegistries() + .getWithResponse("alitest", "ali-ua-test-eh-system-1", "testSchemaGroup1", Context.NONE); + } +} diff --git a/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryListByNamespaceSamples.java b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryListByNamespaceSamples.java new file mode 100644 index 0000000000000..ccd5b492125fb --- /dev/null +++ b/sdk/eventhubs/azure-resourcemanager-eventhubs-generated/src/samples/java/com/azure/resourcemanager/eventhubs/generated/generated/SchemaRegistryListByNamespaceSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for SchemaRegistry ListByNamespace. */ +public final class SchemaRegistryListByNamespaceSamples { + /* + * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryListByNamespace.json + */ + /** + * Sample code: SchemaRegistryListAll. + * + * @param manager Entry point to EventHubsManager. + */ + public static void schemaRegistryListAll(com.azure.resourcemanager.eventhubs.generated.EventHubsManager manager) { + manager.schemaRegistries().listByNamespace("alitest", "ali-ua-test-eh-system-1", null, null, Context.NONE); + } +} 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 7787f3e553dfa..b240fdf180932 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