diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 2e58217d1375..bd3c1724b048 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -388,6 +388,7 @@ com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securitydevops;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-appcomplianceautomation;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-servicebus-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/CHANGELOG.md b/sdk/servicebus/azure-resourcemanager-servicebus-generated/CHANGELOG.md new file mode 100644 index 000000000000..24b21756fbd7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-12-14) + +- Azure Resource Manager ServiceBus client library for Java. This package contains Microsoft Azure SDK for ServiceBus Management SDK. Azure Service Bus client for managing Namespace. Package tag package-2022-10-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/README.md b/sdk/servicebus/azure-resourcemanager-servicebus-generated/README.md new file mode 100644 index 000000000000..13224fe969fc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager ServiceBus client library for Java + +Azure Resource Manager ServiceBus client library for Java. + +This package contains Microsoft Azure SDK for ServiceBus Management SDK. Azure Service Bus client for managing Namespace. Package tag package-2022-10-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-servicebus-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-servicebus-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ServiceBusManager manager = ServiceBusManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-resourcemanager-servicebus-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/SAMPLE.md b/sdk/servicebus/azure-resourcemanager-servicebus-generated/SAMPLE.md new file mode 100644 index 000000000000..5c3acc133652 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/SAMPLE.md @@ -0,0 +1,1877 @@ +# Code snippets and samples + + +## 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) + +## MigrationConfigs + +- [CompleteMigration](#migrationconfigs_completemigration) +- [CreateAndStartMigration](#migrationconfigs_createandstartmigration) +- [Delete](#migrationconfigs_delete) +- [Get](#migrationconfigs_get) +- [List](#migrationconfigs_list) +- [Revert](#migrationconfigs_revert) + +## 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) +- [ListNetworkRuleSets](#namespaces_listnetworkrulesets) +- [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) + +## Queues + +- [CreateOrUpdate](#queues_createorupdate) +- [CreateOrUpdateAuthorizationRule](#queues_createorupdateauthorizationrule) +- [Delete](#queues_delete) +- [DeleteAuthorizationRule](#queues_deleteauthorizationrule) +- [Get](#queues_get) +- [GetAuthorizationRule](#queues_getauthorizationrule) +- [ListAuthorizationRules](#queues_listauthorizationrules) +- [ListByNamespace](#queues_listbynamespace) +- [ListKeys](#queues_listkeys) +- [RegenerateKeys](#queues_regeneratekeys) + +## Rules + +- [CreateOrUpdate](#rules_createorupdate) +- [Delete](#rules_delete) +- [Get](#rules_get) +- [ListBySubscriptions](#rules_listbysubscriptions) + +## Subscriptions + +- [CreateOrUpdate](#subscriptions_createorupdate) +- [Delete](#subscriptions_delete) +- [Get](#subscriptions_get) +- [ListByTopic](#subscriptions_listbytopic) + +## Topics + +- [CreateOrUpdate](#topics_createorupdate) +- [CreateOrUpdateAuthorizationRule](#topics_createorupdateauthorizationrule) +- [Delete](#topics_delete) +- [DeleteAuthorizationRule](#topics_deleteauthorizationrule) +- [Get](#topics_get) +- [GetAuthorizationRule](#topics_getauthorizationrule) +- [ListAuthorizationRules](#topics_listauthorizationrules) +- [ListByNamespace](#topics_listbynamespace) +- [ListKeys](#topics_listkeys) +- [RegenerateKeys](#topics_regeneratekeys) +### DisasterRecoveryConfigs_BreakPairing + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs BreakPairing. */ +public final class DisasterRecoveryConfigsBreakPairingSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json + */ + /** + * Sample code: SBEHAliasBreakPairing. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBEHAliasBreakPairing(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .breakPairingWithResponse( + "ardsouzatestRG", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; + +/** Samples for DisasterRecoveryConfigs CheckNameAvailability. */ +public final class DisasterRecoveryConfigsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json + */ + /** + * Sample code: AliasNameAvailability. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void aliasNameAvailability(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .checkNameAvailabilityWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + new CheckNameAvailability().withName("sdk-DisasterRecovery-9474"), + Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_CreateOrUpdate + +```java +/** Samples for DisasterRecoveryConfigs CreateOrUpdate. */ +public final class DisasterRecoveryConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasCreate.json + */ + /** + * Sample code: SBAliasCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .define("sdk-Namespace-8860") + .withExistingNamespace("ardsouzatestRG", "sdk-Namespace-8860") + .withPartnerNamespace("sdk-Namespace-37") + .withAlternateName("alternameforAlias-Namespace-8860") + .create(); + } +} +``` + +### DisasterRecoveryConfigs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Delete. */ +public final class DisasterRecoveryConfigsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasDelete.json + */ + /** + * Sample code: SBAliasDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .deleteWithResponse("SouthCentralUS", "sdk-Namespace-8860", "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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasFailOver.json + */ + /** + * Sample code: SBAliasFailOver. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasFailOver(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .failOverWithResponse( + "ardsouzatestRG", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", null, Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Get. */ +public final class DisasterRecoveryConfigsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasGet.json + */ + /** + * Sample code: SBAliasGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .getWithResponse("ardsouzatestRG", "sdk-Namespace-8860", "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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json + */ + /** + * Sample code: DisasterRecoveryConfigsAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void disasterRecoveryConfigsAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasList.json + */ + /** + * Sample code: SBAliasList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasList(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.disasterRecoveryConfigs().list("ardsouzatestRG", "sdk-Namespace-8860", Context.NONE); + } +} +``` + +### DisasterRecoveryConfigs_ListAuthorizationRules + +```java +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListAuthorizationRules. */ +public final class DisasterRecoveryConfigsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json + */ + /** + * Sample code: DisasterRecoveryConfigsAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void disasterRecoveryConfigsAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .listKeysWithResponse( + "exampleResourceGroup", + "sdk-Namespace-2702", + "sdk-DisasterRecovery-4047", + "sdk-Authrules-1746", + Context.NONE); + } +} +``` + +### MigrationConfigs_CompleteMigration + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs CompleteMigration. */ +public final class MigrationConfigsCompleteMigrationSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json + */ + /** + * Sample code: MigrationConfigurationsCompleteMigration. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsCompleteMigration( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .completeMigrationWithResponse( + "ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} +``` + +### MigrationConfigs_CreateAndStartMigration + +```java +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs CreateAndStartMigration. */ +public final class MigrationConfigsCreateAndStartMigrationSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json + */ + /** + * Sample code: MigrationConfigurationsStartMigration. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsStartMigration( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .define(MigrationConfigurationName.DEFAULT) + .withExistingNamespace("ResourceGroup", "sdk-Namespace-41") + .withTargetNamespace( + "/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028") + .withPostMigrationName("sdk-PostMigration-5919") + .create(); + } +} +``` + +### MigrationConfigs_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs Delete. */ +public final class MigrationConfigsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json + */ + /** + * Sample code: MigrationConfigurationsDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .deleteWithResponse("ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} +``` + +### MigrationConfigs_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs Get. */ +public final class MigrationConfigsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationGet.json + */ + /** + * Sample code: MigrationConfigurationsGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .getWithResponse("ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} +``` + +### MigrationConfigs_List + +```java +import com.azure.core.util.Context; + +/** Samples for MigrationConfigs List. */ +public final class MigrationConfigsListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationList.json + */ + /** + * Sample code: MigrationConfigurationsList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsList( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.migrationConfigs().list("ResourceGroup", "sdk-Namespace-9259", Context.NONE); + } +} +``` + +### MigrationConfigs_Revert + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs Revert. */ +public final class MigrationConfigsRevertSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json + */ + /** + * Sample code: MigrationConfigurationsRevert. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsRevert( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .revertWithResponse("ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} +``` + +### Namespaces_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; + +/** Samples for Namespaces CheckNameAvailability. */ +public final class NamespacesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json + */ + /** + * Sample code: NameSpaceCheckNameAvailability. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceCheckNameAvailability( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + new CheckNameAvailability().withName("sdk-Namespace-2924"), Context.NONE); + } +} +``` + +### Namespaces_CreateOrUpdate + +```java +import com.azure.resourcemanager.servicebus.generated.models.SBSku; +import com.azure.resourcemanager.servicebus.generated.models.SkuName; +import com.azure.resourcemanager.servicebus.generated.models.SkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces CreateOrUpdate. */ +public final class NamespacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceCreate.json + */ + /** + * Sample code: NameSpaceCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .define("sdk-Namespace2924") + .withRegion("South Central US") + .withExistingResourceGroup("ArunMonocle") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSku(new SBSku().withName(SkuName.PREMIUM).withTier(SkuTier.PREMIUM).withCapacity(4)) + .withPremiumMessagingPartitions(2) + .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.servicebus.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ +public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .defineAuthorizationRule("sdk-AuthRules-1788") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-6914") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) + .create(); + } +} +``` + +### Namespaces_CreateOrUpdateNetworkRuleSet + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleIpAction; +import com.azure.resourcemanager.servicebus.generated.models.Subnet; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateNetworkRuleSet. */ +public final class NamespacesCreateOrUpdateNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceNetworkRuleSetCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .createOrUpdateNetworkRuleSetWithResponse( + "ResourceGroup", + "sdk-Namespace-6019", + new NetworkRuleSetInner() + .withDefaultAction(DefaultAction.DENY) + .withVirtualNetworkRules( + Arrays + .asList( + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2")) + .withIgnoreMissingVnetServiceEndpoint(true), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3")) + .withIgnoreMissingVnetServiceEndpoint(false), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceDelete.json + */ + /** + * Sample code: NameSpaceDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().delete("ArunMonocle", "sdk-Namespace-3285", Context.NONE); + } +} +``` + +### Namespaces_DeleteAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces DeleteAuthorizationRule. */ +public final class NamespacesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-namespace-6914", "sdk-AuthRules-1788", Context.NONE); + } +} +``` + +### Namespaces_GetAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetAuthorizationRule. */ +public final class NamespacesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .getAuthorizationRuleWithResponse("ArunMonocle", "sdk-Namespace-6914", "sdk-AuthRules-1788", Context.NONE); + } +} +``` + +### Namespaces_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetByResourceGroup. */ +public final class NamespacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceGet.json + */ + /** + * Sample code: NameSpaceGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().getByResourceGroupWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE); + } +} +``` + +### Namespaces_GetNetworkRuleSet + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetNetworkRuleSet. */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceNetworkRuleSetGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceList.json + */ + /** + * Sample code: NameSpaceList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceList(com.azure.resourcemanager.servicebus.generated.ServiceBusManager 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().listAuthorizationRules("ArunMonocle", "sdk-Namespace-6914", Context.NONE); + } +} +``` + +### Namespaces_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListByResourceGroup. */ +public final class NamespacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceListByResourceGroup.json + */ + /** + * Sample code: NameSpaceListByResourceGroup. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceListByResourceGroup( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().listByResourceGroup("ArunMonocle", Context.NONE); + } +} +``` + +### Namespaces_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListKeys. */ +public final class NamespacesListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .listKeysWithResponse("ArunMonocle", "sdk-namespace-6914", "sdk-AuthRules-1788", Context.NONE); + } +} +``` + +### Namespaces_ListNetworkRuleSets + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces ListNetworkRuleSets. */ +public final class NamespacesListNetworkRuleSetsSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceNetworkRuleSetList( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().listNetworkRuleSets("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} +``` + +### Namespaces_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.KeyType; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Namespaces RegenerateKeys. */ +public final class NamespacesRegenerateKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-namespace-6914", + "sdk-AuthRules-1788", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + +### Namespaces_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespace; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces Update. */ +public final class NamespacesUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceUpdate.json + */ + /** + * Sample code: NameSpaceUpdate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceUpdate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + SBNamespace resource = + manager + .namespaces() + .getByResourceGroupWithResponse("ArunMonocle", "sdk-Namespace-3285", 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; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/SBOperations_List.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void operationsList(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkConnectionStatus; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateEndPointConnectionCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .privateEndpointConnections() + .define("privateEndpointConnectionName") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-2924") + .withPrivateEndpoint( + new PrivateEndpoint() + .withId( + "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateEndPointConnectionDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateEndPointConnectionGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "SDK-ServiceBus-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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json + */ + /** + * Sample code: NameSpaceCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.privateEndpointConnections().list("SDK-ServiceBus-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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateLinkResourcesGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateLinkResourcesGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.privateLinkResources().getWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE); + } +} +``` + +### Queues_CreateOrUpdate + +```java +/** Samples for Queues CreateOrUpdate. */ +public final class QueuesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueCreate.json + */ + /** + * Sample code: QueueCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .define("sdk-Queues-5647") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-3174") + .withEnablePartitioning(true) + .create(); + } +} +``` + +### Queues_CreateOrUpdateAuthorizationRule + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Queues CreateOrUpdateAuthorizationRule. */ +public final class QueuesCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleCreate.json + */ + /** + * Sample code: QueueAuthorizationRuleCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .createOrUpdateAuthorizationRuleWithResponse( + "ArunMonocle", + "sdk-Namespace-7982", + "sdk-Queues-2317", + "sdk-AuthRules-5800", + new SBAuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} +``` + +### Queues_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Queues Delete. */ +public final class QueuesDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueDelete.json + */ + /** + * Sample code: QueueDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().deleteWithResponse("ArunMonocle", "sdk-Namespace-183", "sdk-Queues-8708", Context.NONE); + } +} +``` + +### Queues_DeleteAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Queues DeleteAuthorizationRule. */ +public final class QueuesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleDelete.json + */ + /** + * Sample code: QueueAuthorizationRuleDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-namespace-7982", "sdk-Queues-2317", "sdk-AuthRules-5800", Context.NONE); + } +} +``` + +### Queues_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Queues Get. */ +public final class QueuesGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueGet.json + */ + /** + * Sample code: QueueGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().getWithResponse("ArunMonocle", "sdk-Namespace-3174", "sdk-Queues-5647", Context.NONE); + } +} +``` + +### Queues_GetAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Queues GetAuthorizationRule. */ +public final class QueuesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleGet.json + */ + /** + * Sample code: QueueAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .getAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-7982", "sdk-Queues-2317", "sdk-AuthRules-5800", Context.NONE); + } +} +``` + +### Queues_ListAuthorizationRules + +```java +import com.azure.core.util.Context; + +/** Samples for Queues ListAuthorizationRules. */ +public final class QueuesListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleListAll.json + */ + /** + * Sample code: QueueAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().listAuthorizationRules("ArunMonocle", "sdk-Namespace-7982", "sdk-Queues-2317", Context.NONE); + } +} +``` + +### Queues_ListByNamespace + +```java +import com.azure.core.util.Context; + +/** Samples for Queues ListByNamespace. */ +public final class QueuesListByNamespaceSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueListByNameSpace.json + */ + /** + * Sample code: QueueListByNameSpace. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueListByNameSpace(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().listByNamespace("ArunMonocle", "sdk-Namespace-3174", null, null, Context.NONE); + } +} +``` + +### Queues_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Queues ListKeys. */ +public final class QueuesListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleListKey.json + */ + /** + * Sample code: QueueAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .listKeysWithResponse( + "ArunMonocle", "sdk-namespace-7982", "sdk-Queues-2317", "sdk-AuthRules-5800", Context.NONE); + } +} +``` + +### Queues_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.KeyType; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Queues RegenerateKeys. */ +public final class QueuesRegenerateKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: QueueAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-namespace-7982", + "sdk-Queues-2317", + "sdk-AuthRules-5800", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + +### Rules_CreateOrUpdate + +```java +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Rules CreateOrUpdate. */ +public final class RulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate_CorrelationFilter.json + */ + /** + * Sample code: RulesCreateCorrelationFilter. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesCreateCorrelationFilter( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .define("sdk-Rules-6571") + .withExistingResourceGroup( + "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691") + .withFilterType(FilterType.CORRELATION_FILTER) + .withCorrelationFilter(new CorrelationFilter().withProperties(mapOf("topicHint", "Crop"))) + .create(); + } + + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate.json + */ + /** + * Sample code: RulesCreateOrUpdate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesCreateOrUpdate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .define("sdk-Rules-6571") + .withExistingResourceGroup( + "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691") + .create(); + } + + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate_SqlFilter.json + */ + /** + * Sample code: RulesCreateSqlFilter. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesCreateSqlFilter(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .define("sdk-Rules-6571") + .withExistingResourceGroup( + "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691") + .withFilterType(FilterType.SQL_FILTER) + .withSqlFilter(new SqlFilter().withSqlExpression("myproperty=test")) + .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; + } +} +``` + +### Rules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Rules Delete. */ +public final class RulesDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleDelete.json + */ + /** + * Sample code: RulesDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .deleteWithResponse( + "ArunMonocle", + "sdk-Namespace-1319", + "sdk-Topics-2081", + "sdk-Subscriptions-8691", + "sdk-Rules-6571", + Context.NONE); + } +} +``` + +### Rules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Rules Get. */ +public final class RulesGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleGet.json + */ + /** + * Sample code: RulesGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .getWithResponse( + "ArunMonocle", + "sdk-Namespace-1319", + "sdk-Topics-2081", + "sdk-Subscriptions-8691", + "sdk-Rules-6571", + Context.NONE); + } +} +``` + +### Rules_ListBySubscriptions + +```java +import com.azure.core.util.Context; + +/** Samples for Rules ListBySubscriptions. */ +public final class RulesListBySubscriptionsSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleListBySubscription.json + */ + /** + * Sample code: RulesListBySubscriptions. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesListBySubscriptions( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .listBySubscriptions( + "ArunMonocle", + "sdk-Namespace-1319", + "sdk-Topics-2081", + "sdk-Subscriptions-8691", + null, + null, + Context.NONE); + } +} +``` + +### Subscriptions_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; + +/** Samples for Subscriptions CreateOrUpdate. */ +public final class SubscriptionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionCreate.json + */ + /** + * Sample code: SubscriptionCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .createOrUpdateWithResponse( + "ResourceGroup", + "sdk-Namespace-1349", + "sdk-Topics-8740", + "sdk-Subscriptions-2178", + new SBSubscriptionInner().withEnableBatchedOperations(true), + Context.NONE); + } +} +``` + +### Subscriptions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Subscriptions Delete. */ +public final class SubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionDelete.json + */ + /** + * Sample code: SubscriptionDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .deleteWithResponse( + "ResourceGroup", "sdk-Namespace-5882", "sdk-Topics-1804", "sdk-Subscriptions-3670", Context.NONE); + } +} +``` + +### Subscriptions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Subscriptions Get. */ +public final class SubscriptionsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionGet.json + */ + /** + * Sample code: SubscriptionGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .getWithResponse( + "ResourceGroup", "sdk-Namespace-1349", "sdk-Topics-8740", "sdk-Subscriptions-2178", Context.NONE); + } +} +``` + +### Subscriptions_ListByTopic + +```java +import com.azure.core.util.Context; + +/** Samples for Subscriptions ListByTopic. */ +public final class SubscriptionsListByTopicSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionListByTopic.json + */ + /** + * Sample code: SubscriptionListByTopic. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionListByTopic( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .listByTopic("ResourceGroup", "sdk-Namespace-1349", "sdk-Topics-8740", null, null, Context.NONE); + } +} +``` + +### Topics_CreateOrUpdate + +```java +/** Samples for Topics CreateOrUpdate. */ +public final class TopicsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicCreate.json + */ + /** + * Sample code: TopicCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .define("sdk-Topics-5488") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-1617") + .withEnableExpress(true) + .create(); + } +} +``` + +### Topics_CreateOrUpdateAuthorizationRule + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Topics CreateOrUpdateAuthorizationRule. */ +public final class TopicsCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleCreate.json + */ + /** + * Sample code: TopicAuthorizationRuleCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .createOrUpdateAuthorizationRuleWithResponse( + "ArunMonocle", + "sdk-Namespace-6261", + "sdk-Topics-1984", + "sdk-AuthRules-4310", + new SBAuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} +``` + +### Topics_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Topics Delete. */ +public final class TopicsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicDelete.json + */ + /** + * Sample code: TopicDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().deleteWithResponse("ArunMonocle", "sdk-Namespace-1617", "sdk-Topics-5488", Context.NONE); + } +} +``` + +### Topics_DeleteAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Topics DeleteAuthorizationRule. */ +public final class TopicsDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleDelete.json + */ + /** + * Sample code: TopicAuthorizationRuleDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", "sdk-AuthRules-4310", Context.NONE); + } +} +``` + +### Topics_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Topics Get. */ +public final class TopicsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicGet.json + */ + /** + * Sample code: TopicGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().getWithResponse("ArunMonocle", "sdk-Namespace-1617", "sdk-Topics-5488", Context.NONE); + } +} +``` + +### Topics_GetAuthorizationRule + +```java +import com.azure.core.util.Context; + +/** Samples for Topics GetAuthorizationRule. */ +public final class TopicsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleGet.json + */ + /** + * Sample code: TopicAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .getAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", "sdk-AuthRules-4310", Context.NONE); + } +} +``` + +### Topics_ListAuthorizationRules + +```java +import com.azure.core.util.Context; + +/** Samples for Topics ListAuthorizationRules. */ +public final class TopicsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleListAll.json + */ + /** + * Sample code: TopicAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().listAuthorizationRules("ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", Context.NONE); + } +} +``` + +### Topics_ListByNamespace + +```java +import com.azure.core.util.Context; + +/** Samples for Topics ListByNamespace. */ +public final class TopicsListByNamespaceSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicListByNameSpace.json + */ + /** + * Sample code: TopicGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().listByNamespace("Default-ServiceBus-WestUS", "sdk-Namespace-1617", null, null, Context.NONE); + } +} +``` + +### Topics_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Topics ListKeys. */ +public final class TopicsListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleListKey.json + */ + /** + * Sample code: TopicAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .listKeysWithResponse( + "Default-ServiceBus-WestUS", "sdk-Namespace8408", "sdk-Topics2075", "sdk-Authrules5067", Context.NONE); + } +} +``` + +### Topics_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.KeyType; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Topics RegenerateKeys. */ +public final class TopicsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: TopicAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .regenerateKeysWithResponse( + "Default-ServiceBus-WestUS", + "sdk-Namespace8408", + "sdk-Topics2075", + "sdk-Authrules5067", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/pom.xml b/sdk/servicebus/azure-resourcemanager-servicebus-generated/pom.xml new file mode 100644 index 000000000000..aaaa78d022de --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-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-servicebus-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ServiceBus Management + This package contains Microsoft Azure SDK for ServiceBus Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Service Bus client for managing Namespace. Package tag package-2022-10-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.34.0 + + + com.azure + azure-core-management + 1.9.0 + + + diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/ServiceBusManager.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/ServiceBusManager.java new file mode 100644 index 000000000000..e0340e77b300 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/ServiceBusManager.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated; + +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.AddHeadersFromContextPolicy; +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.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.ServiceBusManagementClient; +import com.azure.resourcemanager.servicebus.generated.implementation.DisasterRecoveryConfigsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.MigrationConfigsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.NamespacesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.QueuesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.RulesImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.ServiceBusManagementClientBuilder; +import com.azure.resourcemanager.servicebus.generated.implementation.SubscriptionsImpl; +import com.azure.resourcemanager.servicebus.generated.implementation.TopicsImpl; +import com.azure.resourcemanager.servicebus.generated.models.DisasterRecoveryConfigs; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigs; +import com.azure.resourcemanager.servicebus.generated.models.Namespaces; +import com.azure.resourcemanager.servicebus.generated.models.Operations; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.servicebus.generated.models.Queues; +import com.azure.resourcemanager.servicebus.generated.models.Rules; +import com.azure.resourcemanager.servicebus.generated.models.Subscriptions; +import com.azure.resourcemanager.servicebus.generated.models.Topics; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ServiceBusManager. Azure Service Bus client for managing Namespace. */ +public final class ServiceBusManager { + private Namespaces namespaces; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private Operations operations; + + private DisasterRecoveryConfigs disasterRecoveryConfigs; + + private MigrationConfigs migrationConfigs; + + private Queues queues; + + private Topics topics; + + private Rules rules; + + private Subscriptions subscriptions; + + private final ServiceBusManagementClient clientObject; + + private ServiceBusManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ServiceBusManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ServiceBus service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceBus service API instance. + */ + public static ServiceBusManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of ServiceBus service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ServiceBus service API instance. + */ + public static ServiceBusManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ServiceBusManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ServiceBusManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ServiceBusManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ServiceBus service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceBus service API instance. + */ + public ServiceBusManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.servicebus.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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 ServiceBusManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Namespaces. It manages SBNamespace, SBAuthorizationRule. + * + * @return Resource collection API of Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + } + return namespaces; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of DisasterRecoveryConfigs. It manages ArmDisasterRecovery. + * + * @return Resource collection API of DisasterRecoveryConfigs. + */ + public DisasterRecoveryConfigs disasterRecoveryConfigs() { + if (this.disasterRecoveryConfigs == null) { + this.disasterRecoveryConfigs = + new DisasterRecoveryConfigsImpl(clientObject.getDisasterRecoveryConfigs(), this); + } + return disasterRecoveryConfigs; + } + + /** + * Gets the resource collection API of MigrationConfigs. It manages MigrationConfigProperties. + * + * @return Resource collection API of MigrationConfigs. + */ + public MigrationConfigs migrationConfigs() { + if (this.migrationConfigs == null) { + this.migrationConfigs = new MigrationConfigsImpl(clientObject.getMigrationConfigs(), this); + } + return migrationConfigs; + } + + /** + * Gets the resource collection API of Queues. It manages SBQueue. + * + * @return Resource collection API of Queues. + */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(clientObject.getQueues(), this); + } + return queues; + } + + /** + * Gets the resource collection API of Topics. It manages SBTopic. + * + * @return Resource collection API of Topics. + */ + public Topics topics() { + if (this.topics == null) { + this.topics = new TopicsImpl(clientObject.getTopics(), this); + } + return topics; + } + + /** + * Gets the resource collection API of Rules. It manages Rule. + * + * @return Resource collection API of Rules. + */ + public Rules rules() { + if (this.rules == null) { + this.rules = new RulesImpl(clientObject.getRules(), this); + } + return rules; + } + + /** + * Gets the resource collection API of Subscriptions. + * + * @return Resource collection API of Subscriptions. + */ + public Subscriptions subscriptions() { + if (this.subscriptions == null) { + this.subscriptions = new SubscriptionsImpl(clientObject.getSubscriptions(), this); + } + return subscriptions; + } + + /** + * @return Wrapped service client ServiceBusManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ServiceBusManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/DisasterRecoveryConfigsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/DisasterRecoveryConfigsClient.java new file mode 100644 index 000000000000..6ebcb810af60 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/DisasterRecoveryConfigsClient.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; + +/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ +public interface DisasterRecoveryConfigsClient { + /** + * 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) as paginated response with {@link PagedIterable}. + */ + @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) as paginated response with {@link PagedIterable}. + */ + @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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, 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); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * Gets 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); + + /** + * 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); + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context); + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/MigrationConfigsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/MigrationConfigsClient.java new file mode 100644 index 000000000000..ca7947445544 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/MigrationConfigsClient.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** An instance of this class provides access to all the operations defined in MigrationConfigsClient. */ +public interface MigrationConfigsClient { + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationConfigPropertiesInner> beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters); + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationConfigPropertiesInner> beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context); + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters); + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, MigrationConfigurationName configName, Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationConfigPropertiesInner get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void completeMigration(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/NamespacesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/NamespacesClient.java new file mode 100644 index 000000000000..61a2d5840e5a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/NamespacesClient.java @@ -0,0 +1,561 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +public interface NamespacesClient { + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters); + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context); + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters); + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @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 SyncPoller} for polling of long-running operation. + */ + @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 a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, Context context); + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBNamespaceInner update(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRuleSetInner createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + + /** + * 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) + NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName); + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName); + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNetworkRuleSets( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets 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); + + /** + * 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); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/OperationsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/OperationsClient.java new file mode 100644 index 000000000000..550b1b2f38a0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..f4dc139433d9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateEndpointConnectionsClient.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.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateLinkResourcesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..e18b72343cdb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/QueuesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/QueuesClient.java new file mode 100644 index 000000000000..380964541f54 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/QueuesClient.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** An instance of this class provides access to all the operations defined in QueuesClient. */ +public interface QueuesClient { + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName); + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, Context context); + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBQueueInner createOrUpdate( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String queueName); + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBQueueInner get(String resourceGroupName, String namespaceName, String queueName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/RulesClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/RulesClient.java new file mode 100644 index 000000000000..0af436e56366 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/RulesClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; + +/** An instance of this class provides access to all the operations defined in RulesClient. */ +public interface RulesClient { + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context); + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters, + Context context); + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters); + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/ServiceBusManagementClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/ServiceBusManagementClient.java new file mode 100644 index 000000000000..13583bd732e5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/ServiceBusManagementClient.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ServiceBusManagementClient class. */ +public interface ServiceBusManagementClient { + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + NamespacesClient getNamespaces(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the DisasterRecoveryConfigsClient object to access its operations. + * + * @return the DisasterRecoveryConfigsClient object. + */ + DisasterRecoveryConfigsClient getDisasterRecoveryConfigs(); + + /** + * Gets the MigrationConfigsClient object to access its operations. + * + * @return the MigrationConfigsClient object. + */ + MigrationConfigsClient getMigrationConfigs(); + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + QueuesClient getQueues(); + + /** + * Gets the TopicsClient object to access its operations. + * + * @return the TopicsClient object. + */ + TopicsClient getTopics(); + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + RulesClient getRules(); + + /** + * Gets the SubscriptionsClient object to access its operations. + * + * @return the SubscriptionsClient object. + */ + SubscriptionsClient getSubscriptions(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/SubscriptionsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/SubscriptionsClient.java new file mode 100644 index 000000000000..e12aec8b88a7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/SubscriptionsClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; + +/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ +public interface SubscriptionsClient { + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTopic(String resourceGroupName, String namespaceName, String topicName); + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context); + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context); + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBSubscriptionInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters); + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBSubscriptionInner get(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/TopicsClient.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/TopicsClient.java new file mode 100644 index 000000000000..b59baf4ff07f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/TopicsClient.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** An instance of this class provides access to all the operations defined in TopicsClient. */ +public interface TopicsClient { + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName); + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, Context context); + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBTopicInner createOrUpdate( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName, String topicName); + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SBTopicInner get(String resourceGroupName, String namespaceName, String topicName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/AccessKeysInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/AccessKeysInner.java new file mode 100644 index 000000000000..eeea22d7cb35 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/AccessKeysInner.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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Namespace/ServiceBus Connection String. */ +@Immutable +public final class AccessKeysInner { + /* + * Primary connection string of the created namespace authorization rule. + */ + @JsonProperty(value = "primaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String primaryConnectionString; + + /* + * Secondary connection string of the created namespace authorization rule. + */ + @JsonProperty(value = "secondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryConnectionString; + + /* + * Primary connection string of the alias if GEO DR is enabled + */ + @JsonProperty(value = "aliasPrimaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String aliasPrimaryConnectionString; + + /* + * Secondary connection string of the alias if GEO DR is enabled + */ + @JsonProperty(value = "aliasSecondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String aliasSecondaryConnectionString; + + /* + * A base64-encoded 256-bit primary key for signing and validating the SAS token. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /* + * A base64-encoded 256-bit primary key for signing and validating the SAS token. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /* + * A string that describes the authorization rule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** Creates an instance of AccessKeysInner class. */ + public AccessKeysInner() { + } + + /** + * Get the primaryConnectionString property: Primary connection string of the created namespace authorization rule. + * + * @return the primaryConnectionString value. + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Get the secondaryConnectionString property: Secondary connection string of the created namespace authorization + * rule. + * + * @return the secondaryConnectionString value. + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Get the aliasPrimaryConnectionString property: Primary connection string of the alias if GEO DR is enabled. + * + * @return the aliasPrimaryConnectionString value. + */ + public String aliasPrimaryConnectionString() { + return this.aliasPrimaryConnectionString; + } + + /** + * Get the aliasSecondaryConnectionString property: Secondary connection string of the alias if GEO DR is enabled. + * + * @return the aliasSecondaryConnectionString value. + */ + public String aliasSecondaryConnectionString() { + return this.aliasSecondaryConnectionString; + } + + /** + * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get the keyName property: A string that describes the authorization rule. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryInner.java new file mode 100644 index 000000000000..f8cbb3a24dd5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryInner.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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.servicebus.generated.models.RoleDisasterRecovery; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single item in List or Get Alias(Disaster Recovery configuration) operation. */ +@Fluent +public final class ArmDisasterRecoveryInner extends ProxyResource { + /* + * 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; + + /** Creates an instance of ArmDisasterRecoveryInner class. */ + public ArmDisasterRecoveryInner() { + } + + /** + * 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 pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.innerProperties() == null ? null : this.innerProperties().pendingReplicationOperationsCount(); + } + + /** + * Get the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO + * DR pairing. + * + * @return the partnerNamespace value. + */ + public String partnerNamespace() { + return this.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: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.innerProperties() == null ? null : this.innerProperties().alternateName(); + } + + /** + * Set the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @param alternateName the alternateName value to set. + * @return the ArmDisasterRecoveryInner object itself. + */ + public ArmDisasterRecoveryInner withAlternateName(String alternateName) { + 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryProperties.java new file mode 100644 index 000000000000..6fcda104c37d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/ArmDisasterRecoveryProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.servicebus.generated.models.RoleDisasterRecovery; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties required to the Create Or Update Alias(Disaster Recovery configurations). */ +@Fluent +public final class ArmDisasterRecoveryProperties { + /* + * 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; + + /* + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long pendingReplicationOperationsCount; + + /* + * ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + */ + @JsonProperty(value = "partnerNamespace") + private String partnerNamespace; + + /* + * Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + */ + @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; + + /** Creates an instance of ArmDisasterRecoveryProperties class. */ + public ArmDisasterRecoveryProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Alias(Disaster Recovery configuration) - possible + * values 'Accepted' or 'Succeeded' or 'Failed'. + * + * @return the provisioningState value. + */ + public ProvisioningStateDR provisioningState() { + return this.provisioningState; + } + + /** + * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Get the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO + * DR pairing. + * + * @return the partnerNamespace value. + */ + public String partnerNamespace() { + return this.partnerNamespace; + } + + /** + * Set the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO + * DR pairing. + * + * @param partnerNamespace the partnerNamespace value to set. + * @return the ArmDisasterRecoveryProperties object itself. + */ + public ArmDisasterRecoveryProperties withPartnerNamespace(String partnerNamespace) { + this.partnerNamespace = partnerNamespace; + return this; + } + + /** + * Get the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @param alternateName the alternateName value to set. + * @return the 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..bbcad8861010 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.UnavailableReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a Check Name availability request properties. */ +@Fluent +public final class CheckNameAvailabilityResultInner { + /* + * The detailed info regarding the reason associated with the namespace. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Value indicating namespace is availability, true if the namespace is available; otherwise, false. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason for unavailability of a namespace. + */ + @JsonProperty(value = "reason") + private UnavailableReason reason; + + /** Creates an instance of CheckNameAvailabilityResultInner class. */ + public CheckNameAvailabilityResultInner() { + } + + /** + * Get the message property: The detailed info regarding the reason associated with the namespace. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the nameAvailable property: Value indicating namespace is availability, true if the namespace is available; + * otherwise, false. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Value indicating namespace is availability, true if the namespace is available; + * otherwise, false. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason for unavailability of a namespace. + * + * @return the reason value. + */ + public UnavailableReason reason() { + return this.reason; + } + + /** + * Set the reason property: The reason for unavailability of a namespace. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withReason(UnavailableReason reason) { + this.reason = reason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/FailoverPropertiesProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/FailoverPropertiesProperties.java new file mode 100644 index 000000000000..cf4b53efef7d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/FailoverPropertiesProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Safe failover is to indicate the service should wait for pending replication to finish before switching to the + * secondary. + */ +@Fluent +public final class FailoverPropertiesProperties { + /* + * Safe failover is to indicate the service should wait for pending replication to finish before switching to the + * secondary. + */ + @JsonProperty(value = "IsSafeFailover") + private Boolean isSafeFailover; + + /** Creates an instance of FailoverPropertiesProperties class. */ + public FailoverPropertiesProperties() { + } + + /** + * Get the isSafeFailover property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @return the isSafeFailover value. + */ + public Boolean isSafeFailover() { + return this.isSafeFailover; + } + + /** + * Set the isSafeFailover property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @param isSafeFailover the isSafeFailover value to set. + * @return the FailoverPropertiesProperties object itself. + */ + public FailoverPropertiesProperties withIsSafeFailover(Boolean isSafeFailover) { + this.isSafeFailover = isSafeFailover; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesInner.java new file mode 100644 index 000000000000..9a31e6ad578b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single item in List or Get Migration Config operation. */ +@Fluent +public final class MigrationConfigPropertiesInner extends ProxyResource { + /* + * Properties required to the Create Migration Configuration + */ + @JsonProperty(value = "properties") + private MigrationConfigPropertiesProperties 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; + + /** Creates an instance of MigrationConfigPropertiesInner class. */ + public MigrationConfigPropertiesInner() { + } + + /** + * Get the innerProperties property: Properties required to the Create Migration Configuration. + * + * @return the innerProperties value. + */ + private MigrationConfigPropertiesProperties 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 Migration Configuration. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * 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(); + } + + /** + * Get the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * + * @return the targetNamespace value. + */ + public String targetNamespace() { + return this.innerProperties() == null ? null : this.innerProperties().targetNamespace(); + } + + /** + * Set the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * + * @param targetNamespace the targetNamespace value to set. + * @return the MigrationConfigPropertiesInner object itself. + */ + public MigrationConfigPropertiesInner withTargetNamespace(String targetNamespace) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationConfigPropertiesProperties(); + } + this.innerProperties().withTargetNamespace(targetNamespace); + return this; + } + + /** + * Get the postMigrationName property: Name to access Standard Namespace after migration. + * + * @return the postMigrationName value. + */ + public String postMigrationName() { + return this.innerProperties() == null ? null : this.innerProperties().postMigrationName(); + } + + /** + * Set the postMigrationName property: Name to access Standard Namespace after migration. + * + * @param postMigrationName the postMigrationName value to set. + * @return the MigrationConfigPropertiesInner object itself. + */ + public MigrationConfigPropertiesInner withPostMigrationName(String postMigrationName) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationConfigPropertiesProperties(); + } + this.innerProperties().withPostMigrationName(postMigrationName); + return this; + } + + /** + * Get the migrationState property: State in which Standard to Premium Migration is, possible values : Unknown, + * Reverting, Completing, Initiating, Syncing, Active. + * + * @return the migrationState value. + */ + public String migrationState() { + return this.innerProperties() == null ? null : this.innerProperties().migrationState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesProperties.java new file mode 100644 index 000000000000..aea06fc33da3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/MigrationConfigPropertiesProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties required to the Create Migration Configuration. */ +@Fluent +public final class MigrationConfigPropertiesProperties { + /* + * Provisioning state of Migration Configuration + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long pendingReplicationOperationsCount; + + /* + * Existing premium Namespace ARM Id name which has no entities, will be used for migration + */ + @JsonProperty(value = "targetNamespace", required = true) + private String targetNamespace; + + /* + * Name to access Standard Namespace after migration + */ + @JsonProperty(value = "postMigrationName", required = true) + private String postMigrationName; + + /* + * State in which Standard to Premium Migration is, possible values : Unknown, Reverting, Completing, Initiating, + * Syncing, Active + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private String migrationState; + + /** Creates an instance of MigrationConfigPropertiesProperties class. */ + public MigrationConfigPropertiesProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of Migration Configuration. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + + /** + * Get the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * + * @return the targetNamespace value. + */ + public String targetNamespace() { + return this.targetNamespace; + } + + /** + * Set the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * + * @param targetNamespace the targetNamespace value to set. + * @return the MigrationConfigPropertiesProperties object itself. + */ + public MigrationConfigPropertiesProperties withTargetNamespace(String targetNamespace) { + this.targetNamespace = targetNamespace; + return this; + } + + /** + * Get the postMigrationName property: Name to access Standard Namespace after migration. + * + * @return the postMigrationName value. + */ + public String postMigrationName() { + return this.postMigrationName; + } + + /** + * Set the postMigrationName property: Name to access Standard Namespace after migration. + * + * @param postMigrationName the postMigrationName value to set. + * @return the MigrationConfigPropertiesProperties object itself. + */ + public MigrationConfigPropertiesProperties withPostMigrationName(String postMigrationName) { + this.postMigrationName = postMigrationName; + return this; + } + + /** + * Get the migrationState property: State in which Standard to Premium Migration is, possible values : Unknown, + * Reverting, Completing, Initiating, Syncing, Active. + * + * @return the migrationState value. + */ + public String migrationState() { + return this.migrationState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetNamespace() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetNamespace in model MigrationConfigPropertiesProperties")); + } + if (postMigrationName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property postMigrationName in model MigrationConfigPropertiesProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrationConfigPropertiesProperties.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetInner.java new file mode 100644 index 000000000000..1b25bd598767 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccessFlag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of NetworkRuleSet resource. */ +@Fluent +public final class NetworkRuleSetInner extends ProxyResource { + /* + * 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; + + /** Creates an instance of NetworkRuleSetInner class. */ + public NetworkRuleSetInner() { + } + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetProperties.java new file mode 100644 index 000000000000..654159d563b2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/NetworkRuleSetProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccessFlag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkRuleSet properties. */ +@Fluent +public final class NetworkRuleSetProperties { + /* + * 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; + + /** Creates an instance of NetworkRuleSetProperties class. */ + public NetworkRuleSetProperties() { + } + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/OperationInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/OperationInner.java new file mode 100644 index 000000000000..2e2f93c83ab6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Service Bus REST API operation. */ +@Fluent +public final class OperationInner { + /* + * 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; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..3d06fa699221 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnection. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..4a3624c8f89f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..bd5ac12695f5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of PrivateLinkResource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The groupId property. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * Required Members + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * Required Zone Names + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The groupId property. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The groupId property. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: Required Members. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: Required Members. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: Required Zone Names. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: Required Zone Names. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourcesListResultInner.java new file mode 100644 index 000000000000..458a20aed815 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/PrivateLinkResourcesListResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List private link resources operation. */ +@Fluent +public final class PrivateLinkResourcesListResultInner { + /* + * A collection of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of private link resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PrivateLinkResourcesListResultInner class. */ + public PrivateLinkResourcesListResultInner() { + } + + /** + * Get the value property: A collection of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of private link resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of private link resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/RuleInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/RuleInner.java new file mode 100644 index 000000000000..b3ea83eef7cb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/RuleInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.Action; +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of Rule Resource. */ +@Fluent +public final class RuleInner extends ProxyResource { + /* + * Properties of Rule resource + */ + @JsonProperty(value = "properties") + private Ruleproperties 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; + + /** Creates an instance of RuleInner class. */ + public RuleInner() { + } + + /** + * Get the innerProperties property: Properties of Rule resource. + * + * @return the innerProperties value. + */ + private Ruleproperties 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 action property: Represents the filter actions which are allowed for the transformation of a message that + * have been matched by a filter expression. + * + * @return the action value. + */ + public Action action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: Represents the filter actions which are allowed for the transformation of a message that + * have been matched by a filter expression. + * + * @param action the action value to set. + * @return the RuleInner object itself. + */ + public RuleInner withAction(Action action) { + if (this.innerProperties() == null) { + this.innerProperties = new Ruleproperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @return the filterType value. + */ + public FilterType filterType() { + return this.innerProperties() == null ? null : this.innerProperties().filterType(); + } + + /** + * Set the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @param filterType the filterType value to set. + * @return the RuleInner object itself. + */ + public RuleInner withFilterType(FilterType filterType) { + if (this.innerProperties() == null) { + this.innerProperties = new Ruleproperties(); + } + this.innerProperties().withFilterType(filterType); + return this; + } + + /** + * Get the sqlFilter property: Properties of sqlFilter. + * + * @return the sqlFilter value. + */ + public SqlFilter sqlFilter() { + return this.innerProperties() == null ? null : this.innerProperties().sqlFilter(); + } + + /** + * Set the sqlFilter property: Properties of sqlFilter. + * + * @param sqlFilter the sqlFilter value to set. + * @return the RuleInner object itself. + */ + public RuleInner withSqlFilter(SqlFilter sqlFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new Ruleproperties(); + } + this.innerProperties().withSqlFilter(sqlFilter); + return this; + } + + /** + * Get the correlationFilter property: Properties of correlationFilter. + * + * @return the correlationFilter value. + */ + public CorrelationFilter correlationFilter() { + return this.innerProperties() == null ? null : this.innerProperties().correlationFilter(); + } + + /** + * Set the correlationFilter property: Properties of correlationFilter. + * + * @param correlationFilter the correlationFilter value to set. + * @return the RuleInner object itself. + */ + public RuleInner withCorrelationFilter(CorrelationFilter correlationFilter) { + if (this.innerProperties() == null) { + this.innerProperties = new Ruleproperties(); + } + this.innerProperties().withCorrelationFilter(correlationFilter); + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/Ruleproperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/Ruleproperties.java new file mode 100644 index 000000000000..3091780d3bbe --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/Ruleproperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.Action; +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of Rule Resource. */ +@Fluent +public final class Ruleproperties { + /* + * Represents the filter actions which are allowed for the transformation of a message that have been matched by a + * filter expression. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Filter type that is evaluated against a BrokeredMessage. + */ + @JsonProperty(value = "filterType") + private FilterType filterType; + + /* + * Properties of sqlFilter + */ + @JsonProperty(value = "sqlFilter") + private SqlFilter sqlFilter; + + /* + * Properties of correlationFilter + */ + @JsonProperty(value = "correlationFilter") + private CorrelationFilter correlationFilter; + + /** Creates an instance of Ruleproperties class. */ + public Ruleproperties() { + } + + /** + * Get the action property: Represents the filter actions which are allowed for the transformation of a message that + * have been matched by a filter expression. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: Represents the filter actions which are allowed for the transformation of a message that + * have been matched by a filter expression. + * + * @param action the action value to set. + * @return the Ruleproperties object itself. + */ + public Ruleproperties withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @return the filterType value. + */ + public FilterType filterType() { + return this.filterType; + } + + /** + * Set the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @param filterType the filterType value to set. + * @return the Ruleproperties object itself. + */ + public Ruleproperties withFilterType(FilterType filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get the sqlFilter property: Properties of sqlFilter. + * + * @return the sqlFilter value. + */ + public SqlFilter sqlFilter() { + return this.sqlFilter; + } + + /** + * Set the sqlFilter property: Properties of sqlFilter. + * + * @param sqlFilter the sqlFilter value to set. + * @return the Ruleproperties object itself. + */ + public Ruleproperties withSqlFilter(SqlFilter sqlFilter) { + this.sqlFilter = sqlFilter; + return this; + } + + /** + * Get the correlationFilter property: Properties of correlationFilter. + * + * @return the correlationFilter value. + */ + public CorrelationFilter correlationFilter() { + return this.correlationFilter; + } + + /** + * Set the correlationFilter property: Properties of correlationFilter. + * + * @param correlationFilter the correlationFilter value to set. + * @return the Ruleproperties object itself. + */ + public Ruleproperties withCorrelationFilter(CorrelationFilter correlationFilter) { + this.correlationFilter = correlationFilter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() != null) { + action().validate(); + } + if (sqlFilter() != null) { + sqlFilter().validate(); + } + if (correlationFilter() != null) { + correlationFilter().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleInner.java new file mode 100644 index 000000000000..e66a5dc6e4de --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of a namespace authorization rule. */ +@Fluent +public final class SBAuthorizationRuleInner extends ProxyResource { + /* + * AuthorizationRule properties. + */ + @JsonProperty(value = "properties") + private SBAuthorizationRuleProperties 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; + + /** Creates an instance of SBAuthorizationRuleInner class. */ + public SBAuthorizationRuleInner() { + } + + /** + * Get the innerProperties property: AuthorizationRule properties. + * + * @return the innerProperties value. + */ + private SBAuthorizationRuleProperties 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 SBAuthorizationRuleInner object itself. + */ + public SBAuthorizationRuleInner withRights(List rights) { + if (this.innerProperties() == null) { + this.innerProperties = new SBAuthorizationRuleProperties(); + } + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleProperties.java new file mode 100644 index 000000000000..fdf7dae48d03 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBAuthorizationRuleProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AuthorizationRule properties. */ +@Fluent +public final class SBAuthorizationRuleProperties { + /* + * The rights associated with the rule. + */ + @JsonProperty(value = "rights", required = true) + private List rights; + + /** Creates an instance of SBAuthorizationRuleProperties class. */ + public SBAuthorizationRuleProperties() { + } + + /** + * 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 SBAuthorizationRuleProperties object itself. + */ + public SBAuthorizationRuleProperties 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 SBAuthorizationRuleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SBAuthorizationRuleProperties.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceInner.java new file mode 100644 index 000000000000..ae294e841809 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceInner.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.Encryption; +import com.azure.resourcemanager.servicebus.generated.models.Identity; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.servicebus.generated.models.SBSku; +import com.azure.resourcemanager.servicebus.generated.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Description of a namespace resource. */ +@Fluent +public final class SBNamespaceInner extends Resource { + /* + * Properties of SKU + */ + @JsonProperty(value = "sku") + private SBSku sku; + + /* + * Properties of BYOK Identity description + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of the namespace. + */ + @JsonProperty(value = "properties") + private SBNamespaceProperties innerProperties; + + /** Creates an instance of SBNamespaceInner class. */ + public SBNamespaceInner() { + } + + /** + * Get the sku property: Properties of SKU. + * + * @return the sku value. + */ + public SBSku sku() { + return this.sku; + } + + /** + * Set the sku property: Properties of SKU. + * + * @param sku the sku value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withSku(SBSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Properties of BYOK Identity description. + * + * @param identity the identity value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Properties of the namespace. + * + * @return the innerProperties value. + */ + private SBNamespaceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + 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 metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.innerProperties() == null ? null : this.innerProperties().metricId(); + } + + /** + * Get the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.innerProperties() == null ? null : this.innerProperties().zoneRedundant(); + } + + /** + * Set the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withZoneRedundant(Boolean zoneRedundant) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + 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 SBNamespaceInner object itself. + */ + public SBNamespaceInner withEncryption(Encryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + 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 SBNamespaceInner object itself. + */ + public SBNamespaceInner withPrivateEndpointConnections( + List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.innerProperties() == null ? null : this.innerProperties().disableLocalAuth(); + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withDisableLocalAuth(Boolean disableLocalAuth) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + this.innerProperties().withDisableLocalAuth(disableLocalAuth); + return this; + } + + /** + * Get the alternateName property: Alternate name for namespace. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.innerProperties() == null ? null : this.innerProperties().alternateName(); + } + + /** + * Set the alternateName property: Alternate name for namespace. + * + * @param alternateName the alternateName value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withAlternateName(String alternateName) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + this.innerProperties().withAlternateName(alternateName); + 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 PublicNetworkAccess 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 SBNamespaceInner object itself. + */ + public SBNamespaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the premiumMessagingPartitions property: The number of partitions of a Service Bus namespace. This property + * is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. + * + * @return the premiumMessagingPartitions value. + */ + public Integer premiumMessagingPartitions() { + return this.innerProperties() == null ? null : this.innerProperties().premiumMessagingPartitions(); + } + + /** + * Set the premiumMessagingPartitions property: The number of partitions of a Service Bus namespace. This property + * is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. + * + * @param premiumMessagingPartitions the premiumMessagingPartitions value to set. + * @return the SBNamespaceInner object itself. + */ + public SBNamespaceInner withPremiumMessagingPartitions(Integer premiumMessagingPartitions) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceProperties(); + } + this.innerProperties().withPremiumMessagingPartitions(premiumMessagingPartitions); + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceProperties.java new file mode 100644 index 000000000000..fef327ee55f7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceProperties.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.Encryption; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.servicebus.generated.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of the namespace. */ +@Fluent +public final class SBNamespaceProperties { + /* + * The minimum TLS version for the cluster to support, e.g. '1.2' + */ + @JsonProperty(value = "minimumTlsVersion") + private TlsVersion minimumTlsVersion; + + /* + * 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; + + /* + * Identifier for Azure Insights metrics + */ + @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. + */ + @JsonProperty(value = "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 Service Bus namespace. + */ + @JsonProperty(value = "disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * Alternate name for namespace + */ + @JsonProperty(value = "alternateName") + private String alternateName; + + /* + * This determines if traffic is allowed over public network. By default it is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * The number of partitions of a Service Bus namespace. This property is only applicable to Premium SKU namespaces. + * The default value is 1 and possible values are 1, 2 and 4 + */ + @JsonProperty(value = "premiumMessagingPartitions") + private Integer premiumMessagingPartitions; + + /** Creates an instance of SBNamespaceProperties class. */ + public SBNamespaceProperties() { + } + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the SBNamespaceProperties object itself. + */ + public SBNamespaceProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the namespace. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the namespace. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the SBNamespaceProperties object itself. + */ + public SBNamespaceProperties 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 SBNamespaceProperties object itself. + */ + public SBNamespaceProperties 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 SBNamespaceProperties object itself. + */ + public SBNamespaceProperties withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the SBNamespaceProperties object itself. + */ + public SBNamespaceProperties withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Get the alternateName property: Alternate name for namespace. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set the alternateName property: Alternate name for namespace. + * + * @param alternateName the alternateName value to set. + * @return the SBNamespaceProperties object itself. + */ + public SBNamespaceProperties withAlternateName(String alternateName) { + this.alternateName = alternateName; + 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 PublicNetworkAccess 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 SBNamespaceProperties object itself. + */ + public SBNamespaceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the premiumMessagingPartitions property: The number of partitions of a Service Bus namespace. This property + * is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. + * + * @return the premiumMessagingPartitions value. + */ + public Integer premiumMessagingPartitions() { + return this.premiumMessagingPartitions; + } + + /** + * Set the premiumMessagingPartitions property: The number of partitions of a Service Bus namespace. This property + * is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. + * + * @param premiumMessagingPartitions the premiumMessagingPartitions value to set. + * @return the SBNamespaceProperties object itself. + */ + public SBNamespaceProperties withPremiumMessagingPartitions(Integer premiumMessagingPartitions) { + this.premiumMessagingPartitions = premiumMessagingPartitions; + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceUpdateProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceUpdateProperties.java new file mode 100644 index 000000000000..68431ee0f246 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBNamespaceUpdateProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.Encryption; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of the namespace. */ +@Fluent +public final class SBNamespaceUpdateProperties { + /* + * 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; + + /* + * Identifier for Azure Insights metrics + */ + @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * 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 Service Bus namespace. + */ + @JsonProperty(value = "disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * Alternate name for namespace + */ + @JsonProperty(value = "alternateName") + private String alternateName; + + /** Creates an instance of SBNamespaceUpdateProperties class. */ + public SBNamespaceUpdateProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the namespace. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the namespace. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the 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 SBNamespaceUpdateProperties object itself. + */ + public SBNamespaceUpdateProperties 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 SBNamespaceUpdateProperties object itself. + */ + public SBNamespaceUpdateProperties withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the SBNamespaceUpdateProperties object itself. + */ + public SBNamespaceUpdateProperties withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Get the alternateName property: Alternate name for namespace. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set the alternateName property: Alternate name for namespace. + * + * @param alternateName the alternateName value to set. + * @return the SBNamespaceUpdateProperties object itself. + */ + public SBNamespaceUpdateProperties 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueInner.java new file mode 100644 index 000000000000..977288f82c80 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueInner.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of queue Resource. */ +@Fluent +public final class SBQueueInner extends ProxyResource { + /* + * Queue Properties + */ + @JsonProperty(value = "properties") + private SBQueueProperties 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; + + /** Creates an instance of SBQueueInner class. */ + public SBQueueInner() { + } + + /** + * Get the innerProperties property: Queue Properties. + * + * @return the innerProperties value. + */ + private SBQueueProperties 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 countDetails property: Message Count Details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.innerProperties() == null ? null : this.innerProperties().countDetails(); + } + + /** + * Get the createdAt property: The 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 accessedAt property: Last time a message was sent, or the last time there was a receive request to this + * queue. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.innerProperties() == null ? null : this.innerProperties().accessedAt(); + } + + /** + * Get the sizeInBytes property: The size of the queue, in bytes. + * + * @return the sizeInBytes value. + */ + public Long sizeInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().sizeInBytes(); + } + + /** + * Get the messageCount property: The number of messages in the queue. + * + * @return the messageCount value. + */ + public Long messageCount() { + return this.innerProperties() == null ? null : this.innerProperties().messageCount(); + } + + /** + * Get the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 + * minute. + * + * @return the lockDuration value. + */ + public Duration lockDuration() { + return this.innerProperties() == null ? null : this.innerProperties().lockDuration(); + } + + /** + * Set the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 + * minute. + * + * @param lockDuration the lockDuration value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withLockDuration(Duration lockDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withLockDuration(lockDuration); + return this; + } + + /** + * Get the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * + * @return the maxSizeInMegabytes value. + */ + public Integer maxSizeInMegabytes() { + return this.innerProperties() == null ? null : this.innerProperties().maxSizeInMegabytes(); + } + + /** + * Set the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * + * @param maxSizeInMegabytes the maxSizeInMegabytes value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + /** + * Get the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + public Long maxMessageSizeInKilobytes() { + return this.innerProperties() == null ? null : this.innerProperties().maxMessageSizeInKilobytes(); + } + + /** + * Set the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @param maxMessageSizeInKilobytes the maxMessageSizeInKilobytes value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withMaxMessageSizeInKilobytes(maxMessageSizeInKilobytes); + return this; + } + + /** + * Get the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + public Boolean requiresDuplicateDetection() { + return this.innerProperties() == null ? null : this.innerProperties().requiresDuplicateDetection(); + } + + /** + * Set the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @param requiresDuplicateDetection the requiresDuplicateDetection value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + /** + * Get the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @return the requiresSession value. + */ + public Boolean requiresSession() { + return this.innerProperties() == null ? null : this.innerProperties().requiresSession(); + } + + /** + * Set the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @param requiresSession the requiresSession value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withRequiresSession(Boolean requiresSession) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withRequiresSession(requiresSession); + return this; + } + + /** + * Get the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + public Duration defaultMessageTimeToLive() { + return this.innerProperties() == null ? null : this.innerProperties().defaultMessageTimeToLive(); + } + + /** + * Set the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + /** + * Get the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + public Boolean deadLetteringOnMessageExpiration() { + return this.innerProperties() == null ? null : this.innerProperties().deadLetteringOnMessageExpiration(); + } + + /** + * Set the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has dead letter + * support when a message expires. + * + * @param deadLetteringOnMessageExpiration the deadLetteringOnMessageExpiration value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpiration); + return this; + } + + /** + * Get the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerProperties() == null ? null : this.innerProperties().duplicateDetectionHistoryTimeWindow(); + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + /** + * Get the maxDeliveryCount property: The maximum delivery count. A message is automatically deadlettered after this + * number of deliveries. default value is 10. + * + * @return the maxDeliveryCount value. + */ + public Integer maxDeliveryCount() { + return this.innerProperties() == null ? null : this.innerProperties().maxDeliveryCount(); + } + + /** + * Set the maxDeliveryCount property: The maximum delivery count. A message is automatically deadlettered after this + * number of deliveries. default value is 10. + * + * @param maxDeliveryCount the maxDeliveryCount value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withMaxDeliveryCount(Integer maxDeliveryCount) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withMaxDeliveryCount(maxDeliveryCount); + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withStatus(EntityStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.innerProperties() == null ? null : this.innerProperties().enableBatchedOperations(); + } + + /** + * Set the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withEnableBatchedOperations(Boolean enableBatchedOperations) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + /** + * Get the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.innerProperties() == null ? null : this.innerProperties().autoDeleteOnIdle(); + } + + /** + * Set the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + /** + * Get the enablePartitioning property: A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + * + * @return the enablePartitioning value. + */ + public Boolean enablePartitioning() { + return this.innerProperties() == null ? null : this.innerProperties().enablePartitioning(); + } + + /** + * Set the enablePartitioning property: A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + * + * @param enablePartitioning the enablePartitioning value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withEnablePartitioning(Boolean enablePartitioning) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withEnablePartitioning(enablePartitioning); + return this; + } + + /** + * Get the enableExpress property: A value that indicates whether Express Entities are enabled. An express queue + * holds a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value. + */ + public Boolean enableExpress() { + return this.innerProperties() == null ? null : this.innerProperties().enableExpress(); + } + + /** + * Set the enableExpress property: A value that indicates whether Express Entities are enabled. An express queue + * holds a message in memory temporarily before writing it to persistent storage. + * + * @param enableExpress the enableExpress value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withEnableExpress(Boolean enableExpress) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withEnableExpress(enableExpress); + return this; + } + + /** + * Get the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + public String forwardTo() { + return this.innerProperties() == null ? null : this.innerProperties().forwardTo(); + } + + /** + * Set the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo the forwardTo value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withForwardTo(String forwardTo) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withForwardTo(forwardTo); + return this; + } + + /** + * Get the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + public String forwardDeadLetteredMessagesTo() { + return this.innerProperties() == null ? null : this.innerProperties().forwardDeadLetteredMessagesTo(); + } + + /** + * Set the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @param forwardDeadLetteredMessagesTo the forwardDeadLetteredMessagesTo value to set. + * @return the SBQueueInner object itself. + */ + public SBQueueInner withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + if (this.innerProperties() == null) { + this.innerProperties = new SBQueueProperties(); + } + this.innerProperties().withForwardDeadLetteredMessagesTo(forwardDeadLetteredMessagesTo); + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueProperties.java new file mode 100644 index 000000000000..8f937e167deb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBQueueProperties.java @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The Queue Properties definition. */ +@Fluent +public final class SBQueueProperties { + /* + * Message Count Details. + */ + @JsonProperty(value = "countDetails", access = JsonProperty.Access.WRITE_ONLY) + private MessageCountDetails countDetails; + + /* + * The 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; + + /* + * Last time a message was sent, or the last time there was a receive request to this queue. + */ + @JsonProperty(value = "accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessedAt; + + /* + * The size of the queue, in bytes. + */ + @JsonProperty(value = "sizeInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long sizeInBytes; + + /* + * The number of messages in the queue. + */ + @JsonProperty(value = "messageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long messageCount; + + /* + * ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other + * receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + */ + @JsonProperty(value = "lockDuration") + private Duration lockDuration; + + /* + * The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is + * 1024. + */ + @JsonProperty(value = "maxSizeInMegabytes") + private Integer maxSizeInMegabytes; + + /* + * Maximum size (in KB) of the message payload that can be accepted by the queue. This property is only used in + * Premium today and default is 1024. + */ + @JsonProperty(value = "maxMessageSizeInKilobytes") + private Long maxMessageSizeInKilobytes; + + /* + * A value indicating if this queue requires duplicate detection. + */ + @JsonProperty(value = "requiresDuplicateDetection") + private Boolean requiresDuplicateDetection; + + /* + * A value that indicates whether the queue supports the concept of sessions. + */ + @JsonProperty(value = "requiresSession") + private Boolean requiresSession; + + /* + * ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting + * from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a + * message itself. + */ + @JsonProperty(value = "defaultMessageTimeToLive") + private Duration defaultMessageTimeToLive; + + /* + * A value that indicates whether this queue has dead letter support when a message expires. + */ + @JsonProperty(value = "deadLetteringOnMessageExpiration") + private Boolean deadLetteringOnMessageExpiration; + + /* + * ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is + * 10 minutes. + */ + @JsonProperty(value = "duplicateDetectionHistoryTimeWindow") + private Duration duplicateDetectionHistoryTimeWindow; + + /* + * The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default + * value is 10. + */ + @JsonProperty(value = "maxDeliveryCount") + private Integer maxDeliveryCount; + + /* + * Enumerates the possible values for the status of a messaging entity. + */ + @JsonProperty(value = "status") + private EntityStatus status; + + /* + * Value that indicates whether server-side batched operations are enabled. + */ + @JsonProperty(value = "enableBatchedOperations") + private Boolean enableBatchedOperations; + + /* + * ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 + * minutes. + */ + @JsonProperty(value = "autoDeleteOnIdle") + private Duration autoDeleteOnIdle; + + /* + * A value that indicates whether the queue is to be partitioned across multiple message brokers. + */ + @JsonProperty(value = "enablePartitioning") + private Boolean enablePartitioning; + + /* + * A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + * temporarily before writing it to persistent storage. + */ + @JsonProperty(value = "enableExpress") + private Boolean enableExpress; + + /* + * Queue/Topic name to forward the messages + */ + @JsonProperty(value = "forwardTo") + private String forwardTo; + + /* + * Queue/Topic name to forward the Dead Letter message + */ + @JsonProperty(value = "forwardDeadLetteredMessagesTo") + private String forwardDeadLetteredMessagesTo; + + /** Creates an instance of SBQueueProperties class. */ + public SBQueueProperties() { + } + + /** + * Get the countDetails property: Message Count Details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the createdAt property: The exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the accessedAt property: Last time a message was sent, or the last time there was a receive request to this + * queue. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the sizeInBytes property: The size of the queue, in bytes. + * + * @return the sizeInBytes value. + */ + public Long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the messageCount property: The number of messages in the queue. + * + * @return the messageCount value. + */ + public Long messageCount() { + return this.messageCount; + } + + /** + * Get the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 + * minute. + * + * @return the lockDuration value. + */ + public Duration lockDuration() { + return this.lockDuration; + } + + /** + * Set the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 + * minute. + * + * @param lockDuration the lockDuration value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withLockDuration(Duration lockDuration) { + this.lockDuration = lockDuration; + return this; + } + + /** + * Get the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * + * @return the maxSizeInMegabytes value. + */ + public Integer maxSizeInMegabytes() { + return this.maxSizeInMegabytes; + } + + /** + * Set the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * + * @param maxSizeInMegabytes the maxSizeInMegabytes value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.maxSizeInMegabytes = maxSizeInMegabytes; + return this; + } + + /** + * Get the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + public Long maxMessageSizeInKilobytes() { + return this.maxMessageSizeInKilobytes; + } + + /** + * Set the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @param maxMessageSizeInKilobytes the maxMessageSizeInKilobytes value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.maxMessageSizeInKilobytes = maxMessageSizeInKilobytes; + return this; + } + + /** + * Get the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + public Boolean requiresDuplicateDetection() { + return this.requiresDuplicateDetection; + } + + /** + * Set the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @param requiresDuplicateDetection the requiresDuplicateDetection value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.requiresDuplicateDetection = requiresDuplicateDetection; + return this; + } + + /** + * Get the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @return the requiresSession value. + */ + public Boolean requiresSession() { + return this.requiresSession; + } + + /** + * Set the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @param requiresSession the requiresSession value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withRequiresSession(Boolean requiresSession) { + this.requiresSession = requiresSession; + return this; + } + + /** + * Get the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + public Duration defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + public Boolean deadLetteringOnMessageExpiration() { + return this.deadLetteringOnMessageExpiration; + } + + /** + * Set the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has dead letter + * support when a message expires. + * + * @param deadLetteringOnMessageExpiration the deadLetteringOnMessageExpiration value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.deadLetteringOnMessageExpiration = deadLetteringOnMessageExpiration; + return this; + } + + /** + * Get the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the maxDeliveryCount property: The maximum delivery count. A message is automatically deadlettered after this + * number of deliveries. default value is 10. + * + * @return the maxDeliveryCount value. + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the maxDeliveryCount property: The maximum delivery count. A message is automatically deadlettered after this + * number of deliveries. default value is 10. + * + * @param maxDeliveryCount the maxDeliveryCount value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.enableBatchedOperations = enableBatchedOperations; + return this; + } + + /** + * Get the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get the enablePartitioning property: A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + * + * @return the enablePartitioning value. + */ + public Boolean enablePartitioning() { + return this.enablePartitioning; + } + + /** + * Set the enablePartitioning property: A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + * + * @param enablePartitioning the enablePartitioning value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withEnablePartitioning(Boolean enablePartitioning) { + this.enablePartitioning = enablePartitioning; + return this; + } + + /** + * Get the enableExpress property: A value that indicates whether Express Entities are enabled. An express queue + * holds a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value. + */ + public Boolean enableExpress() { + return this.enableExpress; + } + + /** + * Set the enableExpress property: A value that indicates whether Express Entities are enabled. An express queue + * holds a message in memory temporarily before writing it to persistent storage. + * + * @param enableExpress the enableExpress value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withEnableExpress(Boolean enableExpress) { + this.enableExpress = enableExpress; + return this; + } + + /** + * Get the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + public String forwardTo() { + return this.forwardTo; + } + + /** + * Set the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo the forwardTo value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withForwardTo(String forwardTo) { + this.forwardTo = forwardTo; + return this; + } + + /** + * Get the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + public String forwardDeadLetteredMessagesTo() { + return this.forwardDeadLetteredMessagesTo; + } + + /** + * Set the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @param forwardDeadLetteredMessagesTo the forwardDeadLetteredMessagesTo value to set. + * @return the SBQueueProperties object itself. + */ + public SBQueueProperties withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.forwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countDetails() != null) { + countDetails().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionInner.java new file mode 100644 index 000000000000..4cf87d1d8b0d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionInner.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBClientAffineProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of subscription resource. */ +@Fluent +public final class SBSubscriptionInner extends ProxyResource { + /* + * Properties of subscriptions resource. + */ + @JsonProperty(value = "properties") + private SBSubscriptionProperties 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; + + /** Creates an instance of SBSubscriptionInner class. */ + public SBSubscriptionInner() { + } + + /** + * Get the innerProperties property: Properties of subscriptions resource. + * + * @return the innerProperties value. + */ + private SBSubscriptionProperties 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 messageCount property: Number of messages. + * + * @return the messageCount value. + */ + public Long messageCount() { + return this.innerProperties() == null ? null : this.innerProperties().messageCount(); + } + + /** + * 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 accessedAt property: Last time there was a receive request to this subscription. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.innerProperties() == null ? null : this.innerProperties().accessedAt(); + } + + /** + * 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 countDetails property: Message count details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.innerProperties() == null ? null : this.innerProperties().countDetails(); + } + + /** + * Get the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @return the lockDuration value. + */ + public Duration lockDuration() { + return this.innerProperties() == null ? null : this.innerProperties().lockDuration(); + } + + /** + * Set the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @param lockDuration the lockDuration value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withLockDuration(Duration lockDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withLockDuration(lockDuration); + return this; + } + + /** + * Get the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @return the requiresSession value. + */ + public Boolean requiresSession() { + return this.innerProperties() == null ? null : this.innerProperties().requiresSession(); + } + + /** + * Set the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @param requiresSession the requiresSession value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withRequiresSession(Boolean requiresSession) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withRequiresSession(requiresSession); + return this; + } + + /** + * Get the defaultMessageTimeToLive property: ISO 8061 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + public Duration defaultMessageTimeToLive() { + return this.innerProperties() == null ? null : this.innerProperties().defaultMessageTimeToLive(); + } + + /** + * Set the defaultMessageTimeToLive property: ISO 8061 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + /** + * Get the deadLetteringOnFilterEvaluationExceptions property: Value that indicates whether a subscription has dead + * letter support on filter evaluation exceptions. + * + * @return the deadLetteringOnFilterEvaluationExceptions value. + */ + public Boolean deadLetteringOnFilterEvaluationExceptions() { + return this.innerProperties() == null + ? null + : this.innerProperties().deadLetteringOnFilterEvaluationExceptions(); + } + + /** + * Set the deadLetteringOnFilterEvaluationExceptions property: Value that indicates whether a subscription has dead + * letter support on filter evaluation exceptions. + * + * @param deadLetteringOnFilterEvaluationExceptions the deadLetteringOnFilterEvaluationExceptions value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDeadLetteringOnFilterEvaluationExceptions( + Boolean deadLetteringOnFilterEvaluationExceptions) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withDeadLetteringOnFilterEvaluationExceptions(deadLetteringOnFilterEvaluationExceptions); + return this; + } + + /** + * Get the deadLetteringOnMessageExpiration property: Value that indicates whether a subscription has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + public Boolean deadLetteringOnMessageExpiration() { + return this.innerProperties() == null ? null : this.innerProperties().deadLetteringOnMessageExpiration(); + } + + /** + * Set the deadLetteringOnMessageExpiration property: Value that indicates whether a subscription has dead letter + * support when a message expires. + * + * @param deadLetteringOnMessageExpiration the deadLetteringOnMessageExpiration value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpiration); + return this; + } + + /** + * Get the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerProperties() == null ? null : this.innerProperties().duplicateDetectionHistoryTimeWindow(); + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + /** + * Get the maxDeliveryCount property: Number of maximum deliveries. + * + * @return the maxDeliveryCount value. + */ + public Integer maxDeliveryCount() { + return this.innerProperties() == null ? null : this.innerProperties().maxDeliveryCount(); + } + + /** + * Set the maxDeliveryCount property: Number of maximum deliveries. + * + * @param maxDeliveryCount the maxDeliveryCount value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withMaxDeliveryCount(Integer maxDeliveryCount) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withMaxDeliveryCount(maxDeliveryCount); + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withStatus(EntityStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.innerProperties() == null ? null : this.innerProperties().enableBatchedOperations(); + } + + /** + * Set the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withEnableBatchedOperations(Boolean enableBatchedOperations) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + /** + * Get the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.innerProperties() == null ? null : this.innerProperties().autoDeleteOnIdle(); + } + + /** + * Set the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + /** + * Get the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + public String forwardTo() { + return this.innerProperties() == null ? null : this.innerProperties().forwardTo(); + } + + /** + * Set the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo the forwardTo value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withForwardTo(String forwardTo) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withForwardTo(forwardTo); + return this; + } + + /** + * Get the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + public String forwardDeadLetteredMessagesTo() { + return this.innerProperties() == null ? null : this.innerProperties().forwardDeadLetteredMessagesTo(); + } + + /** + * Set the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @param forwardDeadLetteredMessagesTo the forwardDeadLetteredMessagesTo value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withForwardDeadLetteredMessagesTo(forwardDeadLetteredMessagesTo); + return this; + } + + /** + * Get the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @return the isClientAffine value. + */ + public Boolean isClientAffine() { + return this.innerProperties() == null ? null : this.innerProperties().isClientAffine(); + } + + /** + * Set the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @param isClientAffine the isClientAffine value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withIsClientAffine(Boolean isClientAffine) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withIsClientAffine(isClientAffine); + return this; + } + + /** + * Get the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @return the clientAffineProperties value. + */ + public SBClientAffineProperties clientAffineProperties() { + return this.innerProperties() == null ? null : this.innerProperties().clientAffineProperties(); + } + + /** + * Set the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @param clientAffineProperties the clientAffineProperties value to set. + * @return the SBSubscriptionInner object itself. + */ + public SBSubscriptionInner withClientAffineProperties(SBClientAffineProperties clientAffineProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SBSubscriptionProperties(); + } + this.innerProperties().withClientAffineProperties(clientAffineProperties); + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionProperties.java new file mode 100644 index 000000000000..30985e962e7c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBSubscriptionProperties.java @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBClientAffineProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of Subscription Resource. */ +@Fluent +public final class SBSubscriptionProperties { + /* + * Number of messages. + */ + @JsonProperty(value = "messageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long messageCount; + + /* + * Exact time the message was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * Last time there was a receive request to this subscription. + */ + @JsonProperty(value = "accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessedAt; + + /* + * The exact time the message was updated. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Message count details + */ + @JsonProperty(value = "countDetails", access = JsonProperty.Access.WRITE_ONLY) + private MessageCountDetails countDetails; + + /* + * ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + */ + @JsonProperty(value = "lockDuration") + private Duration lockDuration; + + /* + * Value indicating if a subscription supports the concept of sessions. + */ + @JsonProperty(value = "requiresSession") + private Boolean requiresSession; + + /* + * ISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting + * from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a + * message itself. + */ + @JsonProperty(value = "defaultMessageTimeToLive") + private Duration defaultMessageTimeToLive; + + /* + * Value that indicates whether a subscription has dead letter support on filter evaluation exceptions. + */ + @JsonProperty(value = "deadLetteringOnFilterEvaluationExceptions") + private Boolean deadLetteringOnFilterEvaluationExceptions; + + /* + * Value that indicates whether a subscription has dead letter support when a message expires. + */ + @JsonProperty(value = "deadLetteringOnMessageExpiration") + private Boolean deadLetteringOnMessageExpiration; + + /* + * ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is + * 10 minutes. + */ + @JsonProperty(value = "duplicateDetectionHistoryTimeWindow") + private Duration duplicateDetectionHistoryTimeWindow; + + /* + * Number of maximum deliveries. + */ + @JsonProperty(value = "maxDeliveryCount") + private Integer maxDeliveryCount; + + /* + * Enumerates the possible values for the status of a messaging entity. + */ + @JsonProperty(value = "status") + private EntityStatus status; + + /* + * Value that indicates whether server-side batched operations are enabled. + */ + @JsonProperty(value = "enableBatchedOperations") + private Boolean enableBatchedOperations; + + /* + * ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 + * minutes. + */ + @JsonProperty(value = "autoDeleteOnIdle") + private Duration autoDeleteOnIdle; + + /* + * Queue/Topic name to forward the messages + */ + @JsonProperty(value = "forwardTo") + private String forwardTo; + + /* + * Queue/Topic name to forward the Dead Letter message + */ + @JsonProperty(value = "forwardDeadLetteredMessagesTo") + private String forwardDeadLetteredMessagesTo; + + /* + * Value that indicates whether the subscription has an affinity to the client id. + */ + @JsonProperty(value = "isClientAffine") + private Boolean isClientAffine; + + /* + * Properties specific to client affine subscriptions. + */ + @JsonProperty(value = "clientAffineProperties") + private SBClientAffineProperties clientAffineProperties; + + /** Creates an instance of SBSubscriptionProperties class. */ + public SBSubscriptionProperties() { + } + + /** + * Get the messageCount property: Number of messages. + * + * @return the messageCount value. + */ + public Long messageCount() { + return this.messageCount; + } + + /** + * Get the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the accessedAt property: Last time there was a receive request to this subscription. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the countDetails property: Message count details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @return the lockDuration value. + */ + public Duration lockDuration() { + return this.lockDuration; + } + + /** + * Set the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @param lockDuration the lockDuration value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withLockDuration(Duration lockDuration) { + this.lockDuration = lockDuration; + return this; + } + + /** + * Get the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @return the requiresSession value. + */ + public Boolean requiresSession() { + return this.requiresSession; + } + + /** + * Set the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @param requiresSession the requiresSession value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withRequiresSession(Boolean requiresSession) { + this.requiresSession = requiresSession; + return this; + } + + /** + * Get the defaultMessageTimeToLive property: ISO 8061 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + public Duration defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set the defaultMessageTimeToLive property: ISO 8061 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get the deadLetteringOnFilterEvaluationExceptions property: Value that indicates whether a subscription has dead + * letter support on filter evaluation exceptions. + * + * @return the deadLetteringOnFilterEvaluationExceptions value. + */ + public Boolean deadLetteringOnFilterEvaluationExceptions() { + return this.deadLetteringOnFilterEvaluationExceptions; + } + + /** + * Set the deadLetteringOnFilterEvaluationExceptions property: Value that indicates whether a subscription has dead + * letter support on filter evaluation exceptions. + * + * @param deadLetteringOnFilterEvaluationExceptions the deadLetteringOnFilterEvaluationExceptions value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withDeadLetteringOnFilterEvaluationExceptions( + Boolean deadLetteringOnFilterEvaluationExceptions) { + this.deadLetteringOnFilterEvaluationExceptions = deadLetteringOnFilterEvaluationExceptions; + return this; + } + + /** + * Get the deadLetteringOnMessageExpiration property: Value that indicates whether a subscription has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + public Boolean deadLetteringOnMessageExpiration() { + return this.deadLetteringOnMessageExpiration; + } + + /** + * Set the deadLetteringOnMessageExpiration property: Value that indicates whether a subscription has dead letter + * support when a message expires. + * + * @param deadLetteringOnMessageExpiration the deadLetteringOnMessageExpiration value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.deadLetteringOnMessageExpiration = deadLetteringOnMessageExpiration; + return this; + } + + /** + * Get the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withDuplicateDetectionHistoryTimeWindow( + Duration duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the maxDeliveryCount property: Number of maximum deliveries. + * + * @return the maxDeliveryCount value. + */ + public Integer maxDeliveryCount() { + return this.maxDeliveryCount; + } + + /** + * Set the maxDeliveryCount property: Number of maximum deliveries. + * + * @param maxDeliveryCount the maxDeliveryCount value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withMaxDeliveryCount(Integer maxDeliveryCount) { + this.maxDeliveryCount = maxDeliveryCount; + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.enableBatchedOperations = enableBatchedOperations; + return this; + } + + /** + * Get the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + public String forwardTo() { + return this.forwardTo; + } + + /** + * Set the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo the forwardTo value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withForwardTo(String forwardTo) { + this.forwardTo = forwardTo; + return this; + } + + /** + * Get the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + public String forwardDeadLetteredMessagesTo() { + return this.forwardDeadLetteredMessagesTo; + } + + /** + * Set the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @param forwardDeadLetteredMessagesTo the forwardDeadLetteredMessagesTo value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.forwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo; + return this; + } + + /** + * Get the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @return the isClientAffine value. + */ + public Boolean isClientAffine() { + return this.isClientAffine; + } + + /** + * Set the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @param isClientAffine the isClientAffine value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withIsClientAffine(Boolean isClientAffine) { + this.isClientAffine = isClientAffine; + return this; + } + + /** + * Get the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @return the clientAffineProperties value. + */ + public SBClientAffineProperties clientAffineProperties() { + return this.clientAffineProperties; + } + + /** + * Set the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @param clientAffineProperties the clientAffineProperties value to set. + * @return the SBSubscriptionProperties object itself. + */ + public SBSubscriptionProperties withClientAffineProperties(SBClientAffineProperties clientAffineProperties) { + this.clientAffineProperties = clientAffineProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countDetails() != null) { + countDetails().validate(); + } + if (clientAffineProperties() != null) { + clientAffineProperties().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicInner.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicInner.java new file mode 100644 index 000000000000..55e40e6263b7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicInner.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Description of topic resource. */ +@Fluent +public final class SBTopicInner extends ProxyResource { + /* + * Properties of topic resource. + */ + @JsonProperty(value = "properties") + private SBTopicProperties 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; + + /** Creates an instance of SBTopicInner class. */ + public SBTopicInner() { + } + + /** + * Get the innerProperties property: Properties of topic resource. + * + * @return the innerProperties value. + */ + private SBTopicProperties 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 sizeInBytes property: Size of the topic, in bytes. + * + * @return the sizeInBytes value. + */ + public Long sizeInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().sizeInBytes(); + } + + /** + * 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 accessedAt property: Last time the message was sent, or a request was received, for this topic. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.innerProperties() == null ? null : this.innerProperties().accessedAt(); + } + + /** + * Get the subscriptionCount property: Number of subscriptions. + * + * @return the subscriptionCount value. + */ + public Integer subscriptionCount() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionCount(); + } + + /** + * Get the countDetails property: Message count details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.innerProperties() == null ? null : this.innerProperties().countDetails(); + } + + /** + * Get the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + public Duration defaultMessageTimeToLive() { + return this.innerProperties() == null ? null : this.innerProperties().defaultMessageTimeToLive(); + } + + /** + * Set the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + /** + * Get the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * + * @return the maxSizeInMegabytes value. + */ + public Integer maxSizeInMegabytes() { + return this.innerProperties() == null ? null : this.innerProperties().maxSizeInMegabytes(); + } + + /** + * Set the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * + * @param maxSizeInMegabytes the maxSizeInMegabytes value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + /** + * Get the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + public Long maxMessageSizeInKilobytes() { + return this.innerProperties() == null ? null : this.innerProperties().maxMessageSizeInKilobytes(); + } + + /** + * Set the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @param maxMessageSizeInKilobytes the maxMessageSizeInKilobytes value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withMaxMessageSizeInKilobytes(maxMessageSizeInKilobytes); + return this; + } + + /** + * Get the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + public Boolean requiresDuplicateDetection() { + return this.innerProperties() == null ? null : this.innerProperties().requiresDuplicateDetection(); + } + + /** + * Set the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @param requiresDuplicateDetection the requiresDuplicateDetection value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + /** + * Get the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerProperties() == null ? null : this.innerProperties().duplicateDetectionHistoryTimeWindow(); + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.innerProperties() == null ? null : this.innerProperties().enableBatchedOperations(); + } + + /** + * Set the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withEnableBatchedOperations(Boolean enableBatchedOperations) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withStatus(EntityStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @return the supportOrdering value. + */ + public Boolean supportOrdering() { + return this.innerProperties() == null ? null : this.innerProperties().supportOrdering(); + } + + /** + * Set the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @param supportOrdering the supportOrdering value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withSupportOrdering(Boolean supportOrdering) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withSupportOrdering(supportOrdering); + return this; + } + + /** + * Get the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.innerProperties() == null ? null : this.innerProperties().autoDeleteOnIdle(); + } + + /** + * Set the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + /** + * Get the enablePartitioning property: Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * + * @return the enablePartitioning value. + */ + public Boolean enablePartitioning() { + return this.innerProperties() == null ? null : this.innerProperties().enablePartitioning(); + } + + /** + * Set the enablePartitioning property: Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * + * @param enablePartitioning the enablePartitioning value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withEnablePartitioning(Boolean enablePartitioning) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withEnablePartitioning(enablePartitioning); + return this; + } + + /** + * Get the enableExpress property: Value that indicates whether Express Entities are enabled. An express topic holds + * a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value. + */ + public Boolean enableExpress() { + return this.innerProperties() == null ? null : this.innerProperties().enableExpress(); + } + + /** + * Set the enableExpress property: Value that indicates whether Express Entities are enabled. An express topic holds + * a message in memory temporarily before writing it to persistent storage. + * + * @param enableExpress the enableExpress value to set. + * @return the SBTopicInner object itself. + */ + public SBTopicInner withEnableExpress(Boolean enableExpress) { + if (this.innerProperties() == null) { + this.innerProperties = new SBTopicProperties(); + } + this.innerProperties().withEnableExpress(enableExpress); + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicProperties.java new file mode 100644 index 000000000000..7f2392cac604 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/SBTopicProperties.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The Topic Properties definition. */ +@Fluent +public final class SBTopicProperties { + /* + * Size of the topic, in bytes. + */ + @JsonProperty(value = "sizeInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long sizeInBytes; + + /* + * 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; + + /* + * Last time the message was sent, or a request was received, for this topic. + */ + @JsonProperty(value = "accessedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessedAt; + + /* + * Number of subscriptions. + */ + @JsonProperty(value = "subscriptionCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer subscriptionCount; + + /* + * Message count details + */ + @JsonProperty(value = "countDetails", access = JsonProperty.Access.WRITE_ONLY) + private MessageCountDetails countDetails; + + /* + * ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting + * from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a + * message itself. + */ + @JsonProperty(value = "defaultMessageTimeToLive") + private Duration defaultMessageTimeToLive; + + /* + * Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is + * 1024. + */ + @JsonProperty(value = "maxSizeInMegabytes") + private Integer maxSizeInMegabytes; + + /* + * Maximum size (in KB) of the message payload that can be accepted by the topic. This property is only used in + * Premium today and default is 1024. + */ + @JsonProperty(value = "maxMessageSizeInKilobytes") + private Long maxMessageSizeInKilobytes; + + /* + * Value indicating if this topic requires duplicate detection. + */ + @JsonProperty(value = "requiresDuplicateDetection") + private Boolean requiresDuplicateDetection; + + /* + * ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 + * minutes. + */ + @JsonProperty(value = "duplicateDetectionHistoryTimeWindow") + private Duration duplicateDetectionHistoryTimeWindow; + + /* + * Value that indicates whether server-side batched operations are enabled. + */ + @JsonProperty(value = "enableBatchedOperations") + private Boolean enableBatchedOperations; + + /* + * Enumerates the possible values for the status of a messaging entity. + */ + @JsonProperty(value = "status") + private EntityStatus status; + + /* + * Value that indicates whether the topic supports ordering. + */ + @JsonProperty(value = "supportOrdering") + private Boolean supportOrdering; + + /* + * ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 + * minutes. + */ + @JsonProperty(value = "autoDeleteOnIdle") + private Duration autoDeleteOnIdle; + + /* + * Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + */ + @JsonProperty(value = "enablePartitioning") + private Boolean enablePartitioning; + + /* + * Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + * temporarily before writing it to persistent storage. + */ + @JsonProperty(value = "enableExpress") + private Boolean enableExpress; + + /** Creates an instance of SBTopicProperties class. */ + public SBTopicProperties() { + } + + /** + * Get the sizeInBytes property: Size of the topic, in bytes. + * + * @return the sizeInBytes value. + */ + public Long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the accessedAt property: Last time the message was sent, or a request was received, for this topic. + * + * @return the accessedAt value. + */ + public OffsetDateTime accessedAt() { + return this.accessedAt; + } + + /** + * Get the subscriptionCount property: Number of subscriptions. + * + * @return the subscriptionCount value. + */ + public Integer subscriptionCount() { + return this.subscriptionCount; + } + + /** + * Get the countDetails property: Message count details. + * + * @return the countDetails value. + */ + public MessageCountDetails countDetails() { + return this.countDetails; + } + + /** + * Get the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + public Duration defaultMessageTimeToLive() { + return this.defaultMessageTimeToLive; + } + + /** + * Set the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @param defaultMessageTimeToLive the defaultMessageTimeToLive value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.defaultMessageTimeToLive = defaultMessageTimeToLive; + return this; + } + + /** + * Get the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * + * @return the maxSizeInMegabytes value. + */ + public Integer maxSizeInMegabytes() { + return this.maxSizeInMegabytes; + } + + /** + * Set the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * + * @param maxSizeInMegabytes the maxSizeInMegabytes value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.maxSizeInMegabytes = maxSizeInMegabytes; + return this; + } + + /** + * Get the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + public Long maxMessageSizeInKilobytes() { + return this.maxMessageSizeInKilobytes; + } + + /** + * Set the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @param maxMessageSizeInKilobytes the maxMessageSizeInKilobytes value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.maxMessageSizeInKilobytes = maxMessageSizeInKilobytes; + return this; + } + + /** + * Get the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + public Boolean requiresDuplicateDetection() { + return this.requiresDuplicateDetection; + } + + /** + * Set the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @param requiresDuplicateDetection the requiresDuplicateDetection value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.requiresDuplicateDetection = requiresDuplicateDetection; + return this; + } + + /** + * Get the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + public Duration duplicateDetectionHistoryTimeWindow() { + return this.duplicateDetectionHistoryTimeWindow; + } + + /** + * Set the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * + * @param duplicateDetectionHistoryTimeWindow the duplicateDetectionHistoryTimeWindow value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + this.duplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; + return this; + } + + /** + * Get the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + public Boolean enableBatchedOperations() { + return this.enableBatchedOperations; + } + + /** + * Set the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @param enableBatchedOperations the enableBatchedOperations value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.enableBatchedOperations = enableBatchedOperations; + return this; + } + + /** + * Get the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set the status property: Enumerates the possible values for the status of a messaging entity. + * + * @param status the status value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @return the supportOrdering value. + */ + public Boolean supportOrdering() { + return this.supportOrdering; + } + + /** + * Set the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @param supportOrdering the supportOrdering value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withSupportOrdering(Boolean supportOrdering) { + this.supportOrdering = supportOrdering; + return this; + } + + /** + * Get the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + public Duration autoDeleteOnIdle() { + return this.autoDeleteOnIdle; + } + + /** + * Set the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @param autoDeleteOnIdle the autoDeleteOnIdle value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.autoDeleteOnIdle = autoDeleteOnIdle; + return this; + } + + /** + * Get the enablePartitioning property: Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * + * @return the enablePartitioning value. + */ + public Boolean enablePartitioning() { + return this.enablePartitioning; + } + + /** + * Set the enablePartitioning property: Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * + * @param enablePartitioning the enablePartitioning value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withEnablePartitioning(Boolean enablePartitioning) { + this.enablePartitioning = enablePartitioning; + return this; + } + + /** + * Get the enableExpress property: Value that indicates whether Express Entities are enabled. An express topic holds + * a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value. + */ + public Boolean enableExpress() { + return this.enableExpress; + } + + /** + * Set the enableExpress property: Value that indicates whether Express Entities are enabled. An express topic holds + * a message in memory temporarily before writing it to persistent storage. + * + * @param enableExpress the enableExpress value to set. + * @return the SBTopicProperties object itself. + */ + public SBTopicProperties withEnableExpress(Boolean enableExpress) { + this.enableExpress = enableExpress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countDetails() != null) { + countDetails().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/package-info.java new file mode 100644 index 000000000000..aebc6cdfc4a0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for ServiceBusManagementClient. Azure Service Bus client for managing + * Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.fluent.models; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/package-info.java new file mode 100644 index 000000000000..8904d3e4bed6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for ServiceBusManagementClient. Azure Service Bus client for managing + * Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.fluent; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/AccessKeysImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/AccessKeysImpl.java new file mode 100644 index 000000000000..160cd328ea14 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/AccessKeysImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; + +public final class AccessKeysImpl implements AccessKeys { + private AccessKeysInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + AccessKeysImpl( + AccessKeysInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primaryConnectionString() { + return this.innerModel().primaryConnectionString(); + } + + public String secondaryConnectionString() { + return this.innerModel().secondaryConnectionString(); + } + + public String aliasPrimaryConnectionString() { + return this.innerModel().aliasPrimaryConnectionString(); + } + + public String aliasSecondaryConnectionString() { + return this.innerModel().aliasSecondaryConnectionString(); + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public String keyName() { + return this.innerModel().keyName(); + } + + public AccessKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ArmDisasterRecoveryImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ArmDisasterRecoveryImpl.java new file mode 100644 index 000000000000..d5894d81895d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ArmDisasterRecoveryImpl.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.servicebus.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.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.models.ArmDisasterRecovery; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; +import com.azure.resourcemanager.servicebus.generated.models.ProvisioningStateDR; +import com.azure.resourcemanager.servicebus.generated.models.RoleDisasterRecovery; + +public final class ArmDisasterRecoveryImpl + implements ArmDisasterRecovery, ArmDisasterRecovery.Definition, ArmDisasterRecovery.Update { + private ArmDisasterRecoveryInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public ProvisioningStateDR provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long pendingReplicationOperationsCount() { + return this.innerModel().pendingReplicationOperationsCount(); + } + + public String partnerNamespace() { + return this.innerModel().partnerNamespace(); + } + + public String alternateName() { + return this.innerModel().alternateName(); + } + + public RoleDisasterRecovery role() { + return this.innerModel().role(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ArmDisasterRecoveryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String alias; + + public ArmDisasterRecoveryImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public ArmDisasterRecovery create() { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ArmDisasterRecovery create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), context) + .getValue(); + return this; + } + + ArmDisasterRecoveryImpl( + String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new ArmDisasterRecoveryInner(); + this.serviceManager = serviceManager; + this.alias = name; + } + + public ArmDisasterRecoveryImpl update() { + return this; + } + + public ArmDisasterRecovery apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ArmDisasterRecovery apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, this.innerModel(), context) + .getValue(); + return this; + } + + ArmDisasterRecoveryImpl( + ArmDisasterRecoveryInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.alias = Utils.getValueFromIdByName(innerObject.id(), "disasterRecoveryConfigs"); + } + + public ArmDisasterRecovery refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .getWithResponse(resourceGroupName, namespaceName, alias, Context.NONE) + .getValue(); + return this; + } + + public ArmDisasterRecovery refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisasterRecoveryConfigs() + .getWithResponse(resourceGroupName, namespaceName, alias, context) + .getValue(); + return this; + } + + public Response breakPairingWithResponse(Context context) { + return serviceManager + .disasterRecoveryConfigs() + .breakPairingWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public void breakPairing() { + serviceManager.disasterRecoveryConfigs().breakPairing(resourceGroupName, namespaceName, alias); + } + + public Response failOverWithResponse(FailoverProperties parameters, Context context) { + return serviceManager + .disasterRecoveryConfigs() + .failOverWithResponse(resourceGroupName, namespaceName, alias, parameters, context); + } + + public void failOver() { + serviceManager.disasterRecoveryConfigs().failOver(resourceGroupName, namespaceName, alias); + } + + public ArmDisasterRecoveryImpl withPartnerNamespace(String partnerNamespace) { + this.innerModel().withPartnerNamespace(partnerNamespace); + return this; + } + + public ArmDisasterRecoveryImpl withAlternateName(String alternateName) { + this.innerModel().withAlternateName(alternateName); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/CheckNameAvailabilityResultImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..bcb2fad2862b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.servicebus.generated.models.UnavailableReason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public UnavailableReason reason() { + return this.innerModel().reason(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsClientImpl.java new file mode 100644 index 000000000000..1265c8454327 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsClientImpl.java @@ -0,0 +1,2118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.ArmDisasterRecoveryListResult; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigsClient. */ +public final class DisasterRecoveryConfigsClientImpl implements DisasterRecoveryConfigsClient { + /** The proxy service used to perform REST calls. */ + private final DisasterRecoveryConfigsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of DisasterRecoveryConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DisasterRecoveryConfigsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy + .create(DisasterRecoveryConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientDisasterRecoveryConfigs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface DisasterRecoveryConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ArmDisasterRecoveryInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + @ExpectedResponses({200, 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.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> breakPairing( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> failOver( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FailoverProperties parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules" + + "/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules" + + "/{authorizationRuleName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("alias") String alias, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailability parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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); + } + + /** + * 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) as paginated response with {@link PagedFlux}. + */ + @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) as paginated response with {@link PagedFlux}. + */ + @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) as paginated response with {@link PagedIterable}. + */ + @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) as paginated response with {@link PagedIterable}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 createOrUpdateWithResponse(resourceGroupName, namespaceName, alias, parameters, Context.NONE).getValue(); + } + + /** + * 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(ignored -> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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) { + deleteWithResponse(resourceGroupName, namespaceName, alias, Context.NONE); + } + + /** + * 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 getWithResponse(resourceGroupName, namespaceName, alias, Context.NONE).getValue(); + } + + /** + * 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(ignored -> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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) { + breakPairingWithResponse(resourceGroupName, namespaceName, alias, Context.NONE); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> failOverWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .failOver( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> failOverWithResponseAsync( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (alias == null) { + return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .failOver( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + alias, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final FailoverProperties parameters = null; + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, parameters) + .flatMap(ignored -> 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. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context) { + return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, parameters, context).block(); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failOver(String resourceGroupName, String namespaceName, String alias) { + final FailoverProperties parameters = null; + failOverWithResponse(resourceGroupName, namespaceName, alias, parameters, Context.NONE); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace 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 the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace 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 the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String alias) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String alias, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias, context)); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, alias, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 listKeysWithResponse(resourceGroupName, namespaceName, alias, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 URL to get the next list of items + *

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 URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/DisasterRecoveryConfigsImpl.java new file mode 100644 index 000000000000..e964f7db27fa --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.ArmDisasterRecovery; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.servicebus.generated.models.DisasterRecoveryConfigs; +import com.azure.resourcemanager.servicebus.generated.models.FailoverProperties; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; + +public final class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { + private static final ClientLogger LOGGER = new ClientLogger(DisasterRecoveryConfigsImpl.class); + + private final DisasterRecoveryConfigsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public DisasterRecoveryConfigsImpl( + DisasterRecoveryConfigsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public 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 Response deleteWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public void delete(String resourceGroupName, String namespaceName, String alias) { + this.serviceClient().delete(resourceGroupName, namespaceName, alias); + } + + 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 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 breakPairingWithResponse( + String resourceGroupName, String namespaceName, String alias, Context context) { + return this.serviceClient().breakPairingWithResponse(resourceGroupName, namespaceName, alias, context); + } + + public void breakPairing(String resourceGroupName, String namespaceName, String alias) { + this.serviceClient().breakPairing(resourceGroupName, namespaceName, alias); + } + + public Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, Context context) { + return this.serviceClient().failOverWithResponse(resourceGroupName, namespaceName, alias, parameters, context); + } + + public void failOver(String resourceGroupName, String namespaceName, String alias) { + this.serviceClient().failOver(resourceGroupName, namespaceName, alias); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, alias); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, alias, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, alias, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response 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 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 checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters) { + CheckNameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, namespaceName, parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public 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.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public ArmDisasterRecoveryImpl define(String name) { + return new ArmDisasterRecoveryImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigPropertiesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigPropertiesImpl.java new file mode 100644 index 000000000000..2c4f7f04973d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigPropertiesImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigProperties; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +public final class MigrationConfigPropertiesImpl + implements MigrationConfigProperties, MigrationConfigProperties.Definition { + private MigrationConfigPropertiesInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + MigrationConfigPropertiesImpl( + MigrationConfigPropertiesInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long pendingReplicationOperationsCount() { + return this.innerModel().pendingReplicationOperationsCount(); + } + + public String targetNamespace() { + return this.innerModel().targetNamespace(); + } + + public String postMigrationName() { + return this.innerModel().postMigrationName(); + } + + public String migrationState() { + return this.innerModel().migrationState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public MigrationConfigPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private MigrationConfigurationName configName; + + public MigrationConfigPropertiesImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public MigrationConfigProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .createAndStartMigration(resourceGroupName, namespaceName, configName, this.innerModel(), Context.NONE); + return this; + } + + public MigrationConfigProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .createAndStartMigration(resourceGroupName, namespaceName, configName, this.innerModel(), context); + return this; + } + + MigrationConfigPropertiesImpl( + MigrationConfigurationName name, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new MigrationConfigPropertiesInner(); + this.serviceManager = serviceManager; + this.configName = name; + } + + public MigrationConfigProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .getWithResponse(resourceGroupName, namespaceName, configName, Context.NONE) + .getValue(); + return this; + } + + public MigrationConfigProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrationConfigs() + .getWithResponse(resourceGroupName, namespaceName, configName, context) + .getValue(); + return this; + } + + public Response completeMigrationWithResponse(Context context) { + return serviceManager + .migrationConfigs() + .completeMigrationWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void completeMigration() { + serviceManager.migrationConfigs().completeMigration(resourceGroupName, namespaceName, configName); + } + + public Response revertWithResponse(Context context) { + return serviceManager + .migrationConfigs() + .revertWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void revert() { + serviceManager.migrationConfigs().revert(resourceGroupName, namespaceName, configName); + } + + public MigrationConfigPropertiesImpl withTargetNamespace(String targetNamespace) { + this.innerModel().withTargetNamespace(targetNamespace); + return this; + } + + public MigrationConfigPropertiesImpl withPostMigrationName(String postMigrationName) { + this.innerModel().withPostMigrationName(postMigrationName); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsClientImpl.java new file mode 100644 index 000000000000..23d2676a6ae1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsClientImpl.java @@ -0,0 +1,1395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.MigrationConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigListResult; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MigrationConfigsClient. */ +public final class MigrationConfigsClientImpl implements MigrationConfigsClient { + /** The proxy service used to perform REST calls. */ + private final MigrationConfigsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of MigrationConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationConfigsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(MigrationConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientMigrationConfigs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface MigrationConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createAndStartMigration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") MigrationConfigPropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> completeMigration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> revert( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("configName") MigrationConfigurationName configName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations 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 migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations 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 migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createAndStartMigrationWithResponseAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createAndStartMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createAndStartMigrationWithResponseAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createAndStartMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationConfigPropertiesInner> + beginCreateAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + Mono>> mono = + createAndStartMigrationWithResponseAsync(resourceGroupName, namespaceName, configName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationConfigPropertiesInner.class, + MigrationConfigPropertiesInner.class, + this.client.getContext()); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationConfigPropertiesInner> + beginCreateAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createAndStartMigrationWithResponseAsync(resourceGroupName, namespaceName, configName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrationConfigPropertiesInner.class, + MigrationConfigPropertiesInner.class, + context); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationConfigPropertiesInner> + beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters) + .getSyncPoller(); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationConfigPropertiesInner> + beginCreateAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAndStartMigrationAsync( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + return beginCreateAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters) { + return createAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters).block(); + } + + /** + * Creates Migration configuration and starts migration of entities from Standard to Premium namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param parameters Parameters required to create Migration Configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationConfigPropertiesInner createAndStartMigration( + String resourceGroupName, + String namespaceName, + MigrationConfigurationName configName, + MigrationConfigPropertiesInner parameters, + Context context) { + return createAndStartMigrationAsync(resourceGroupName, namespaceName, configName, parameters, context).block(); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, configName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, MigrationConfigurationName configName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + deleteWithResponse(resourceGroupName, namespaceName, configName, Context.NONE); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return getWithResponseAsync(resourceGroupName, namespaceName, configName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationConfigPropertiesInner get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return getWithResponse(resourceGroupName, namespaceName, configName, Context.NONE).getValue(); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeMigrationWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .completeMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeMigrationWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .completeMigration( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono completeMigrationAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return completeMigrationWithResponseAsync(resourceGroupName, namespaceName, configName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return completeMigrationWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void completeMigration( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + completeMigrationWithResponse(resourceGroupName, namespaceName, configName, Context.NONE); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revertWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revert( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revertWithResponseAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revert( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + configName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revertAsync( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + return revertWithResponseAsync(resourceGroupName, namespaceName, configName).flatMap(ignored -> Mono.empty()); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return revertWithResponseAsync(resourceGroupName, namespaceName, configName, context).block(); + } + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + revertWithResponse(resourceGroupName, namespaceName, configName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List migrationConfigurations operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the List migrationConfigurations operation 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsImpl.java new file mode 100644 index 000000000000..8318713f177f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/MigrationConfigsImpl.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.MigrationConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigProperties; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigs; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +public final class MigrationConfigsImpl implements MigrationConfigs { + private static final ClientLogger LOGGER = new ClientLogger(MigrationConfigsImpl.class); + + private final MigrationConfigsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public MigrationConfigsImpl( + MigrationConfigsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new MigrationConfigPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new MigrationConfigPropertiesImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + this.serviceClient().delete(resourceGroupName, namespaceName, configName); + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, configName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MigrationConfigPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigrationConfigProperties get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + MigrationConfigPropertiesInner inner = this.serviceClient().get(resourceGroupName, namespaceName, configName); + if (inner != null) { + return new MigrationConfigPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return this + .serviceClient() + .completeMigrationWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void completeMigration( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + this.serviceClient().completeMigration(resourceGroupName, namespaceName, configName); + } + + public Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context) { + return this.serviceClient().revertWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName) { + this.serviceClient().revert(resourceGroupName, namespaceName, configName); + } + + public MigrationConfigProperties getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String configNameLocal = Utils.getValueFromIdByName(id, "migrationConfigurations"); + if (configNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + MigrationConfigurationName configName = MigrationConfigurationName.fromString(configNameLocal); + return this.getWithResponse(resourceGroupName, namespaceName, configName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String configNameLocal = Utils.getValueFromIdByName(id, "migrationConfigurations"); + if (configNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + MigrationConfigurationName configName = MigrationConfigurationName.fromString(configNameLocal); + return this.getWithResponse(resourceGroupName, namespaceName, configName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String configNameLocal = Utils.getValueFromIdByName(id, "migrationConfigurations"); + if (configNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + MigrationConfigurationName configName = MigrationConfigurationName.fromString(configNameLocal); + this.deleteWithResponse(resourceGroupName, namespaceName, configName, 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 configNameLocal = Utils.getValueFromIdByName(id, "migrationConfigurations"); + if (configNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'migrationConfigurations'.", + id))); + } + MigrationConfigurationName configName = MigrationConfigurationName.fromString(configNameLocal); + return this.deleteWithResponse(resourceGroupName, namespaceName, configName, context); + } + + private MigrationConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public MigrationConfigPropertiesImpl define(MigrationConfigurationName name) { + return new MigrationConfigPropertiesImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesClientImpl.java new file mode 100644 index 000000000000..52ec892a99bc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesClientImpl.java @@ -0,0 +1,3477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleSetListResult; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +public final class NamespacesClientImpl implements NamespacesClient { + /** The proxy service used to perform REST calls. */ + private final NamespacesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of NamespacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NamespacesClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientNamespaces to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface NamespacesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBNamespaceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBNamespaceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/networkRuleSets/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateNetworkRuleSet( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkRuleSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/networkRuleSets/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNetworkRuleSet( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/networkRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNetworkRuleSets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBAuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailability parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNetworkRuleSetsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups 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())); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups 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)); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group 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())); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group 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)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SBNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SBNamespaceInner.class, + SBNamespaceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SBNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SBNamespaceInner.class, SBNamespaceInner.class, context); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SBNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); + } + + /** + * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, SBNamespaceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 PollerFlux} for polling of long-running operation. + */ + @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 PollerFlux} for polling of long-running operation. + */ + @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 SyncPoller} for polling of long-running operation. + */ + @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 SyncPoller} for polling of long-running operation. + */ + @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 a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace 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 a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace 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 a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + } + + /** + * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is + * idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to update a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBNamespaceInner update( + String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE).getValue(); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource 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 NetworkRuleSet 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 NetworkRuleSet 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource 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(); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRuleSetInner createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsSinglePageAsync( + String resourceGroupName, String namespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listNetworkRuleSets( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNetworkRuleSets( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listNetworkRuleSetsAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listNetworkRuleSetsNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listNetworkRuleSetsAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNetworkRuleSetsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listNetworkRuleSetsAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNetworkRuleSets( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listNetworkRuleSetsAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace 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 the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace 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 the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Creates or updates an authorization rule for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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(ignored -> Mono.empty()); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); + } + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String 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 namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String 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 namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String 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(); + } + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailability parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailability parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + } + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponse(parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 URL to get the next list of items + *

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 URL to get the next list of items + *

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 URL to get the next list of items + *

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 URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List NetworkRuleSet operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listNetworkRuleSetsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List NetworkRuleSet operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNetworkRuleSetsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNetworkRuleSetsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesImpl.java new file mode 100644 index 000000000000..70acce2464c9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NamespacesImpl.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.servicebus.generated.models.Namespaces; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespace; + +public final class NamespacesImpl implements Namespaces { + private static final ClientLogger LOGGER = new ClientLogger(NamespacesImpl.class); + + private final NamespacesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public NamespacesImpl( + NamespacesClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SBNamespaceImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String namespaceName) { + this.serviceClient().delete(resourceGroupName, namespaceName); + } + + public void delete(String resourceGroupName, String namespaceName, Context context) { + this.serviceClient().delete(resourceGroupName, namespaceName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBNamespaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBNamespace getByResourceGroup(String resourceGroupName, String namespaceName) { + SBNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); + if (inner != null) { + return new SBNamespaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response 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 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 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 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 PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listNetworkRuleSets(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new NetworkRuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listNetworkRuleSets( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listNetworkRuleSets(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkRuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response 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 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 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 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 checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SBNamespace getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + } + + public SBAuthorizationRule getAuthorizationRuleById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + return this + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + } + + public Response getAuthorizationRuleByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + return this.getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + this.delete(resourceGroupName, namespaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + this.delete(resourceGroupName, namespaceName, context); + } + + public void deleteAuthorizationRuleById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + this.deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); + } + + public Response deleteAuthorizationRuleByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String authorizationRuleName = Utils.getValueFromIdByName(id, "AuthorizationRules"); + if (authorizationRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'AuthorizationRules'.", id))); + } + return this + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + private NamespacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public SBNamespaceImpl define(String name) { + return new SBNamespaceImpl(name, this.manager()); + } + + public SBAuthorizationRuleImpl defineAuthorizationRule(String name) { + return new SBAuthorizationRuleImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NetworkRuleSetImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/NetworkRuleSetImpl.java new file mode 100644 index 000000000000..f79587b2acac --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccessFlag; +import java.util.Collections; +import java.util.List; + +public final class NetworkRuleSetImpl implements NetworkRuleSet { + private NetworkRuleSetInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + NetworkRuleSetImpl( + NetworkRuleSetInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public 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.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationImpl.java new file mode 100644 index 000000000000..6b345407dff8 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.servicebus.generated.models.Operation; +import com.azure.resourcemanager.servicebus.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public 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.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..9fa4cfe61984 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.OperationsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.servicebus.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceBus/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations 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 ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations 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 ServiceBus REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsImpl.java new file mode 100644 index 000000000000..8bcfa1ad4ea4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.OperationsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.servicebus.generated.models.Operation; +import com.azure.resourcemanager.servicebus.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..584416286a02 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionImpl.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.servicebus.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnection; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public 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 String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + ConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public PrivateEndpointConnectionImpl withProvisioningState(EndPointProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..98b53f2116dd --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1034 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 createOrUpdateWithResponse( + resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@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 Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).block(); + } + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection 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. + * + * @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 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. + * + * @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 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection 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(); + } + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 URL to get the next list of items + *

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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..78100510ad86 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, namespaceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + public 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 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 PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..0b6acef3ed43 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientPrivateLinkResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists of resources that supports Privatelinks 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 getWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..841608a0234c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResourcesListResult; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public 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; + } + } + + 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; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 000000000000..c3fc519eef02 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkResourcesListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourcesListResultImpl implements PrivateLinkResourcesListResult { + private PrivateLinkResourcesListResultInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + PrivateLinkResourcesListResultImpl( + PrivateLinkResourcesListResultInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public PrivateLinkResourcesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesClientImpl.java new file mode 100644 index 000000000000..9d480a0079e9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesClientImpl.java @@ -0,0 +1,2305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.QueuesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBQueueListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QueuesClient. */ +public final class QueuesClientImpl implements QueuesClient { + /** The proxy service used to perform REST calls. */ + private final QueuesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of QueuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueuesClientImpl(ServiceBusManagementClientImpl client) { + this.service = RestProxy.create(QueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientQueues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface QueuesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBAuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}" + + "/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBQueueInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("queueName") String queueName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String queueName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName)); + } + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName, context)); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 queueName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context) + .block(); + } + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, Context.NONE); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context) + .block(); + } + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, context) + .block(); + } + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, queueName, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace 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 the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace 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 the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top, context), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top)); + } + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, queueName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, queueName, parameters, context) + .block(); + } + + /** + * Creates or updates a Service Bus queue. This operation is idempotent. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param parameters Parameters supplied to create or update a queue resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBQueueInner createOrUpdate( + String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, namespaceName, queueName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, String queueName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, queueName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 queueName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, queueName, context).block(); + } + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String queueName) { + deleteWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + queueName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String queueName) { + return getWithResponseAsync(resourceGroupName, namespaceName, queueName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, queueName, context).block(); + } + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBQueueInner get(String resourceGroupName, String namespaceName, String queueName) { + return getWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Queues operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Queues operation 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesImpl.java new file mode 100644 index 000000000000..3ea25f6bdd54 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/QueuesImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.QueuesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.Queues; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.azure.resourcemanager.servicebus.generated.models.SBQueue; + +public final class QueuesImpl implements Queues { + private static final ClientLogger LOGGER = new ClientLogger(QueuesImpl.class); + + private final QueuesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public QueuesImpl( + QueuesClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, queueName); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, queueName, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .createOrUpdateAuthorizationRule( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context); + } + + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + this + .serviceClient() + .deleteAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName); + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, queueName, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, queueName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys listKeys( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + AccessKeysInner inner = + this.serviceClient().listKeys(resourceGroupName, namespaceName, queueName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this + .serviceClient() + .regenerateKeys(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SBQueueImpl(inner1, this.manager())); + } + + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByNamespace(resourceGroupName, namespaceName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new SBQueueImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, queueName, context); + } + + public void delete(String resourceGroupName, String namespaceName, String queueName) { + this.serviceClient().delete(resourceGroupName, namespaceName, queueName); + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, queueName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBQueueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBQueue get(String resourceGroupName, String namespaceName, String queueName) { + SBQueueInner inner = this.serviceClient().get(resourceGroupName, namespaceName, queueName); + if (inner != null) { + return new SBQueueImpl(inner, this.manager()); + } else { + return null; + } + } + + public SBQueue getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, queueName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, queueName, context); + } + + private QueuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public SBQueueImpl define(String name) { + return new SBQueueImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RuleImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RuleImpl.java new file mode 100644 index 000000000000..55bbf37f5ded --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RuleImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.servicebus.generated.models.Action; +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.Rule; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; + +public final class RuleImpl implements Rule, Rule.Definition, Rule.Update { + private RuleInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public Action action() { + return this.innerModel().action(); + } + + public FilterType filterType() { + return this.innerModel().filterType(); + } + + public SqlFilter sqlFilter() { + return this.innerModel().sqlFilter(); + } + + public CorrelationFilter correlationFilter() { + return this.innerModel().correlationFilter(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String topicName; + + private String subscriptionName; + + private String ruleName; + + public RuleImpl withExistingResourceGroup( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.topicName = topicName; + this.subscriptionName = subscriptionName; + return this; + } + + public Rule create() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public Rule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + RuleImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new RuleInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public RuleImpl update() { + return this; + } + + public Rule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public Rule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + RuleImpl(RuleInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.topicName = Utils.getValueFromIdByName(innerObject.id(), "topics"); + this.subscriptionName = Utils.getValueFromIdByName(innerObject.id(), "subscriptions"); + this.ruleName = Utils.getValueFromIdByName(innerObject.id(), "rules"); + } + + public Rule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public Rule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context) + .getValue(); + return this; + } + + public RuleImpl withAction(Action action) { + this.innerModel().withAction(action); + return this; + } + + public RuleImpl withFilterType(FilterType filterType) { + this.innerModel().withFilterType(filterType); + return this; + } + + public RuleImpl withSqlFilter(SqlFilter sqlFilter) { + this.innerModel().withSqlFilter(sqlFilter); + return this; + } + + public RuleImpl withCorrelationFilter(CorrelationFilter correlationFilter) { + this.innerModel().withCorrelationFilter(correlationFilter); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesClientImpl.java new file mode 100644 index 000000000000..9c2d31df06cf --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesClientImpl.java @@ -0,0 +1,1146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.RulesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.servicebus.generated.models.RuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RulesClient. */ +public final class RulesClientImpl implements RulesClient { + /** The proxy service used to perform REST calls. */ + private final RulesService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of RulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RulesClientImpl(ServiceBusManagementClientImpl client) { + this.service = RestProxy.create(RulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface RulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptions( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsSinglePageAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySubscriptions( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsSinglePageAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptions( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionsAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top) { + return new PagedFlux<>( + () -> + listBySubscriptionsSinglePageAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top), + nextLink -> listBySubscriptionsNextSinglePageAsync(nextLink)); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionsAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> + listBySubscriptionsSinglePageAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top), + nextLink -> listBySubscriptionsNextSinglePageAsync(nextLink)); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionsAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + return new PagedFlux<>( + () -> + listBySubscriptionsSinglePageAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top, context), + nextLink -> listBySubscriptionsNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>( + listBySubscriptionsAsync(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top)); + } + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + return new PagedIterable<>( + listBySubscriptionsAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, skip, top, context)); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters, context) + .block(); + } + + /** + * Creates a new rule and updates an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param parameters Parameters supplied to create a rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + RuleInner parameters) { + return createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 topicName, + String subscriptionName, + String ruleName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context) + .block(); + } + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context) + .block(); + } + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + return getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesImpl.java new file mode 100644 index 000000000000..2b5666eb5c67 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/RulesImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.RulesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.servicebus.generated.models.Rule; +import com.azure.resourcemanager.servicebus.generated.models.Rules; + +public final class RulesImpl implements Rules { + private static final ClientLogger LOGGER = new ClientLogger(RulesImpl.class); + + private final RulesClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public RulesImpl( + RulesClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + PagedIterable inner = + this.serviceClient().listBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName); + return Utils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + } + + public void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + this.serviceClient().delete(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName); + } + + public Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Rule get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { + RuleInner inner = + this.serviceClient().get(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName); + if (inner != null) { + return new RuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Rule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + String subscriptionName = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, context); + } + + private RulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public RuleImpl define(String name) { + return new RuleImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBAuthorizationRuleImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBAuthorizationRuleImpl.java new file mode 100644 index 000000000000..50f0a7624ad7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBAuthorizationRuleImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import java.util.Collections; +import java.util.List; + +public final class SBAuthorizationRuleImpl + implements SBAuthorizationRule, SBAuthorizationRule.Definition, SBAuthorizationRule.Update { + private SBAuthorizationRuleInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public 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 String resourceGroupName() { + return resourceGroupName; + } + + public SBAuthorizationRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String authorizationRuleName; + + public SBAuthorizationRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SBAuthorizationRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBAuthorizationRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + SBAuthorizationRuleImpl( + String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBAuthorizationRuleInner(); + this.serviceManager = serviceManager; + this.authorizationRuleName = name; + } + + public SBAuthorizationRuleImpl update() { + return this; + } + + public SBAuthorizationRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBAuthorizationRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + SBAuthorizationRuleImpl( + SBAuthorizationRuleInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.authorizationRuleName = Utils.getValueFromIdByName(innerObject.id(), "AuthorizationRules"); + } + + public SBAuthorizationRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); + return this; + } + + public SBAuthorizationRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context) + .getValue(); + return this; + } + + public Response listKeysWithResponse(Context context) { + return serviceManager + .namespaces() + .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public AccessKeys listKeys() { + return serviceManager.namespaces().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + } + + public Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context) { + return serviceManager + .namespaces() + .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + } + + public AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters) { + return serviceManager + .namespaces() + .regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + } + + public SBAuthorizationRuleImpl withRights(List rights) { + this.innerModel().withRights(rights); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBNamespaceImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBNamespaceImpl.java new file mode 100644 index 000000000000..2e898d04463b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBNamespaceImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.azure.resourcemanager.servicebus.generated.models.Encryption; +import com.azure.resourcemanager.servicebus.generated.models.Identity; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.servicebus.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespace; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespaceUpdateParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBSku; +import com.azure.resourcemanager.servicebus.generated.models.TlsVersion; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class SBNamespaceImpl implements SBNamespace, SBNamespace.Definition, SBNamespace.Update { + private SBNamespaceInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SBSku sku() { + return this.innerModel().sku(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public TlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public String serviceBusEndpoint() { + return this.innerModel().serviceBusEndpoint(); + } + + public String metricId() { + return this.innerModel().metricId(); + } + + public Boolean zoneRedundant() { + return this.innerModel().zoneRedundant(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableLocalAuth() { + return this.innerModel().disableLocalAuth(); + } + + public String alternateName() { + return this.innerModel().alternateName(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public Integer premiumMessagingPartitions() { + return this.innerModel().premiumMessagingPartitions(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SBNamespaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private SBNamespaceUpdateParameters updateParameters; + + public SBNamespaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SBNamespace create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), Context.NONE); + return this; + } + + public SBNamespace create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), context); + return this; + } + + SBNamespaceImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBNamespaceInner(); + this.serviceManager = serviceManager; + this.namespaceName = name; + } + + public SBNamespaceImpl update() { + this.updateParameters = new SBNamespaceUpdateParameters(); + return this; + } + + public SBNamespace apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SBNamespace apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, context) + .getValue(); + return this; + } + + SBNamespaceImpl( + SBNamespaceInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + } + + public SBNamespace refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE) + .getValue(); + return this; + } + + public SBNamespace refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, context) + .getValue(); + return this; + } + + public SBNamespaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SBNamespaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SBNamespaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SBNamespaceImpl withSku(SBSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public SBNamespaceImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public SBNamespaceImpl withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.innerModel().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + public SBNamespaceImpl withZoneRedundant(Boolean zoneRedundant) { + this.innerModel().withZoneRedundant(zoneRedundant); + return this; + } + + public SBNamespaceImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public SBNamespaceImpl withPrivateEndpointConnections( + List privateEndpointConnections) { + if (isInCreateMode()) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } else { + this.updateParameters.withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + } + + public SBNamespaceImpl withDisableLocalAuth(Boolean disableLocalAuth) { + if (isInCreateMode()) { + this.innerModel().withDisableLocalAuth(disableLocalAuth); + return this; + } else { + this.updateParameters.withDisableLocalAuth(disableLocalAuth); + return this; + } + } + + public SBNamespaceImpl withAlternateName(String alternateName) { + if (isInCreateMode()) { + this.innerModel().withAlternateName(alternateName); + return this; + } else { + this.updateParameters.withAlternateName(alternateName); + return this; + } + } + + public SBNamespaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public SBNamespaceImpl withPremiumMessagingPartitions(Integer premiumMessagingPartitions) { + this.innerModel().withPremiumMessagingPartitions(premiumMessagingPartitions); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBQueueImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBQueueImpl.java new file mode 100644 index 000000000000..ae350e447f5e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBQueueImpl.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBQueue; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class SBQueueImpl implements SBQueue, SBQueue.Definition, SBQueue.Update { + private SBQueueInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public MessageCountDetails countDetails() { + return this.innerModel().countDetails(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public OffsetDateTime accessedAt() { + return this.innerModel().accessedAt(); + } + + public Long sizeInBytes() { + return this.innerModel().sizeInBytes(); + } + + public Long messageCount() { + return this.innerModel().messageCount(); + } + + public Duration lockDuration() { + return this.innerModel().lockDuration(); + } + + public Integer maxSizeInMegabytes() { + return this.innerModel().maxSizeInMegabytes(); + } + + public Long maxMessageSizeInKilobytes() { + return this.innerModel().maxMessageSizeInKilobytes(); + } + + public Boolean requiresDuplicateDetection() { + return this.innerModel().requiresDuplicateDetection(); + } + + public Boolean requiresSession() { + return this.innerModel().requiresSession(); + } + + public Duration defaultMessageTimeToLive() { + return this.innerModel().defaultMessageTimeToLive(); + } + + public Boolean deadLetteringOnMessageExpiration() { + return this.innerModel().deadLetteringOnMessageExpiration(); + } + + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerModel().duplicateDetectionHistoryTimeWindow(); + } + + public Integer maxDeliveryCount() { + return this.innerModel().maxDeliveryCount(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public Boolean enableBatchedOperations() { + return this.innerModel().enableBatchedOperations(); + } + + public Duration autoDeleteOnIdle() { + return this.innerModel().autoDeleteOnIdle(); + } + + public Boolean enablePartitioning() { + return this.innerModel().enablePartitioning(); + } + + public Boolean enableExpress() { + return this.innerModel().enableExpress(); + } + + public String forwardTo() { + return this.innerModel().forwardTo(); + } + + public String forwardDeadLetteredMessagesTo() { + return this.innerModel().forwardDeadLetteredMessagesTo(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SBQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String queueName; + + public SBQueueImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SBQueue create() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBQueue create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + SBQueueImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBQueueInner(); + this.serviceManager = serviceManager; + this.queueName = name; + } + + public SBQueueImpl update() { + return this; + } + + public SBQueue apply() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBQueue apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + SBQueueImpl( + SBQueueInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.queueName = Utils.getValueFromIdByName(innerObject.id(), "queues"); + } + + public SBQueue refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, namespaceName, queueName, Context.NONE) + .getValue(); + return this; + } + + public SBQueue refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, namespaceName, queueName, context) + .getValue(); + return this; + } + + public SBQueueImpl withLockDuration(Duration lockDuration) { + this.innerModel().withLockDuration(lockDuration); + return this; + } + + public SBQueueImpl withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.innerModel().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + public SBQueueImpl withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.innerModel().withMaxMessageSizeInKilobytes(maxMessageSizeInKilobytes); + return this; + } + + public SBQueueImpl withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.innerModel().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + public SBQueueImpl withRequiresSession(Boolean requiresSession) { + this.innerModel().withRequiresSession(requiresSession); + return this; + } + + public SBQueueImpl withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.innerModel().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + public SBQueueImpl withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration) { + this.innerModel().withDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpiration); + return this; + } + + public SBQueueImpl withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + this.innerModel().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + public SBQueueImpl withMaxDeliveryCount(Integer maxDeliveryCount) { + this.innerModel().withMaxDeliveryCount(maxDeliveryCount); + return this; + } + + public SBQueueImpl withStatus(EntityStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public SBQueueImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.innerModel().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + public SBQueueImpl withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.innerModel().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + public SBQueueImpl withEnablePartitioning(Boolean enablePartitioning) { + this.innerModel().withEnablePartitioning(enablePartitioning); + return this; + } + + public SBQueueImpl withEnableExpress(Boolean enableExpress) { + this.innerModel().withEnableExpress(enableExpress); + return this; + } + + public SBQueueImpl withForwardTo(String forwardTo) { + this.innerModel().withForwardTo(forwardTo); + return this; + } + + public SBQueueImpl withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo) { + this.innerModel().withForwardDeadLetteredMessagesTo(forwardDeadLetteredMessagesTo); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBSubscriptionImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBSubscriptionImpl.java new file mode 100644 index 000000000000..4caa075135c1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBSubscriptionImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBClientAffineProperties; +import com.azure.resourcemanager.servicebus.generated.models.SBSubscription; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class SBSubscriptionImpl implements SBSubscription { + private SBSubscriptionInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + SBSubscriptionImpl( + SBSubscriptionInner innerObject, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public Long messageCount() { + return this.innerModel().messageCount(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime accessedAt() { + return this.innerModel().accessedAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public MessageCountDetails countDetails() { + return this.innerModel().countDetails(); + } + + public Duration lockDuration() { + return this.innerModel().lockDuration(); + } + + public Boolean requiresSession() { + return this.innerModel().requiresSession(); + } + + public Duration defaultMessageTimeToLive() { + return this.innerModel().defaultMessageTimeToLive(); + } + + public Boolean deadLetteringOnFilterEvaluationExceptions() { + return this.innerModel().deadLetteringOnFilterEvaluationExceptions(); + } + + public Boolean deadLetteringOnMessageExpiration() { + return this.innerModel().deadLetteringOnMessageExpiration(); + } + + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerModel().duplicateDetectionHistoryTimeWindow(); + } + + public Integer maxDeliveryCount() { + return this.innerModel().maxDeliveryCount(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public Boolean enableBatchedOperations() { + return this.innerModel().enableBatchedOperations(); + } + + public Duration autoDeleteOnIdle() { + return this.innerModel().autoDeleteOnIdle(); + } + + public String forwardTo() { + return this.innerModel().forwardTo(); + } + + public String forwardDeadLetteredMessagesTo() { + return this.innerModel().forwardDeadLetteredMessagesTo(); + } + + public Boolean isClientAffine() { + return this.innerModel().isClientAffine(); + } + + public SBClientAffineProperties clientAffineProperties() { + return this.innerModel().clientAffineProperties(); + } + + public SBSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBTopicImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBTopicImpl.java new file mode 100644 index 000000000000..275b9a76f574 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SBTopicImpl.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.EntityStatus; +import com.azure.resourcemanager.servicebus.generated.models.MessageCountDetails; +import com.azure.resourcemanager.servicebus.generated.models.SBTopic; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class SBTopicImpl implements SBTopic, SBTopic.Definition, SBTopic.Update { + private SBTopicInner innerObject; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + public Long sizeInBytes() { + return this.innerModel().sizeInBytes(); + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public OffsetDateTime accessedAt() { + return this.innerModel().accessedAt(); + } + + public Integer subscriptionCount() { + return this.innerModel().subscriptionCount(); + } + + public MessageCountDetails countDetails() { + return this.innerModel().countDetails(); + } + + public Duration defaultMessageTimeToLive() { + return this.innerModel().defaultMessageTimeToLive(); + } + + public Integer maxSizeInMegabytes() { + return this.innerModel().maxSizeInMegabytes(); + } + + public Long maxMessageSizeInKilobytes() { + return this.innerModel().maxMessageSizeInKilobytes(); + } + + public Boolean requiresDuplicateDetection() { + return this.innerModel().requiresDuplicateDetection(); + } + + public Duration duplicateDetectionHistoryTimeWindow() { + return this.innerModel().duplicateDetectionHistoryTimeWindow(); + } + + public Boolean enableBatchedOperations() { + return this.innerModel().enableBatchedOperations(); + } + + public EntityStatus status() { + return this.innerModel().status(); + } + + public Boolean supportOrdering() { + return this.innerModel().supportOrdering(); + } + + public Duration autoDeleteOnIdle() { + return this.innerModel().autoDeleteOnIdle(); + } + + public Boolean enablePartitioning() { + return this.innerModel().enablePartitioning(); + } + + public Boolean enableExpress() { + return this.innerModel().enableExpress(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SBTopicInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String topicName; + + public SBTopicImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public SBTopic create() { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBTopic create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, topicName, this.innerModel(), context) + .getValue(); + return this; + } + + SBTopicImpl(String name, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = new SBTopicInner(); + this.serviceManager = serviceManager; + this.topicName = name; + } + + public SBTopicImpl update() { + return this; + } + + public SBTopic apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SBTopic apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, topicName, this.innerModel(), context) + .getValue(); + return this; + } + + SBTopicImpl( + SBTopicInner innerObject, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.topicName = Utils.getValueFromIdByName(innerObject.id(), "topics"); + } + + public SBTopic refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .getWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE) + .getValue(); + return this; + } + + public SBTopic refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTopics() + .getWithResponse(resourceGroupName, namespaceName, topicName, context) + .getValue(); + return this; + } + + public SBTopicImpl withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive) { + this.innerModel().withDefaultMessageTimeToLive(defaultMessageTimeToLive); + return this; + } + + public SBTopicImpl withMaxSizeInMegabytes(Integer maxSizeInMegabytes) { + this.innerModel().withMaxSizeInMegabytes(maxSizeInMegabytes); + return this; + } + + public SBTopicImpl withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes) { + this.innerModel().withMaxMessageSizeInKilobytes(maxMessageSizeInKilobytes); + return this; + } + + public SBTopicImpl withRequiresDuplicateDetection(Boolean requiresDuplicateDetection) { + this.innerModel().withRequiresDuplicateDetection(requiresDuplicateDetection); + return this; + } + + public SBTopicImpl withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow) { + this.innerModel().withDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindow); + return this; + } + + public SBTopicImpl withEnableBatchedOperations(Boolean enableBatchedOperations) { + this.innerModel().withEnableBatchedOperations(enableBatchedOperations); + return this; + } + + public SBTopicImpl withStatus(EntityStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public SBTopicImpl withSupportOrdering(Boolean supportOrdering) { + this.innerModel().withSupportOrdering(supportOrdering); + return this; + } + + public SBTopicImpl withAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + this.innerModel().withAutoDeleteOnIdle(autoDeleteOnIdle); + return this; + } + + public SBTopicImpl withEnablePartitioning(Boolean enablePartitioning) { + this.innerModel().withEnablePartitioning(enablePartitioning); + return this; + } + + public SBTopicImpl withEnableExpress(Boolean enableExpress) { + this.innerModel().withEnableExpress(enableExpress); + return this; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientBuilder.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientBuilder.java new file mode 100644 index 000000000000..e60f0b62715f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.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.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ServiceBusManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ServiceBusManagementClientImpl.class}) +public final class ServiceBusManagementClientBuilder { + /* + * Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part + * of the URI for every service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ServiceBusManagementClientBuilder. + */ + public ServiceBusManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ServiceBusManagementClientImpl with the provided parameters. + * + * @return an instance of ServiceBusManagementClientImpl. + */ + public ServiceBusManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ServiceBusManagementClientImpl client = + new ServiceBusManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientImpl.java new file mode 100644 index 000000000000..9a39770e592d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/ServiceBusManagementClientImpl.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.servicebus.generated.fluent.DisasterRecoveryConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.MigrationConfigsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.NamespacesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.OperationsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.QueuesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.RulesClient; +import com.azure.resourcemanager.servicebus.generated.fluent.ServiceBusManagementClient; +import com.azure.resourcemanager.servicebus.generated.fluent.SubscriptionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.TopicsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ServiceBusManagementClientImpl type. */ +@ServiceClient(builder = ServiceBusManagementClientBuilder.class) +public final class ServiceBusManagementClientImpl implements ServiceBusManagementClient { + /** + * Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The NamespacesClient object to access its operations. */ + private final NamespacesClient namespaces; + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + public NamespacesClient getNamespaces() { + return this.namespaces; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The DisasterRecoveryConfigsClient object to access its operations. */ + private final DisasterRecoveryConfigsClient disasterRecoveryConfigs; + + /** + * Gets the DisasterRecoveryConfigsClient object to access its operations. + * + * @return the DisasterRecoveryConfigsClient object. + */ + public DisasterRecoveryConfigsClient getDisasterRecoveryConfigs() { + return this.disasterRecoveryConfigs; + } + + /** The MigrationConfigsClient object to access its operations. */ + private final MigrationConfigsClient migrationConfigs; + + /** + * Gets the MigrationConfigsClient object to access its operations. + * + * @return the MigrationConfigsClient object. + */ + public MigrationConfigsClient getMigrationConfigs() { + return this.migrationConfigs; + } + + /** The QueuesClient object to access its operations. */ + private final QueuesClient queues; + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + public QueuesClient getQueues() { + return this.queues; + } + + /** The TopicsClient object to access its operations. */ + private final TopicsClient topics; + + /** + * Gets the TopicsClient object to access its operations. + * + * @return the TopicsClient object. + */ + public TopicsClient getTopics() { + return this.topics; + } + + /** The RulesClient object to access its operations. */ + private final RulesClient rules; + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + public RulesClient getRules() { + return this.rules; + } + + /** The SubscriptionsClient object to access its operations. */ + private final SubscriptionsClient subscriptions; + + /** + * Gets the SubscriptionsClient object to access its operations. + * + * @return the SubscriptionsClient object. + */ + public SubscriptionsClient getSubscriptions() { + return this.subscriptions; + } + + /** + * Initializes an instance of ServiceBusManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials that uniquely identify a Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ServiceBusManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-10-01-preview"; + this.namespaces = new NamespacesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsClientImpl(this); + this.migrationConfigs = new MigrationConfigsClientImpl(this); + this.queues = new QueuesClientImpl(this); + this.topics = new TopicsClientImpl(this); + this.rules = new RulesClientImpl(this); + this.subscriptions = new SubscriptionsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceBusManagementClientImpl.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsClientImpl.java new file mode 100644 index 000000000000..da37b63bb3b3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsClientImpl.java @@ -0,0 +1,1024 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.SubscriptionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.azure.resourcemanager.servicebus.generated.models.SBSubscriptionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ +public final class SubscriptionsClientImpl implements SubscriptionsClient { + /** The proxy service used to perform REST calls. */ + private final SubscriptionsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of SubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionsClientImpl(ServiceBusManagementClientImpl client) { + this.service = + RestProxy.create(SubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface SubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTopic( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBSubscriptionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("subscriptionName") String subscriptionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTopicNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTopic( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTopic( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTopicAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top), + nextLink -> listByTopicNextSinglePageAsync(nextLink)); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTopicAsync( + String resourceGroupName, String namespaceName, String topicName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top), + nextLink -> listByTopicNextSinglePageAsync(nextLink)); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTopicAsync( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listByTopicSinglePageAsync(resourceGroupName, namespaceName, topicName, skip, top, context), + nextLink -> listByTopicNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByTopicAsync(resourceGroupName, namespaceName, topicName, skip, top)); + } + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + return new PagedIterable<>(listByTopicAsync(resourceGroupName, namespaceName, topicName, skip, top, context)); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters, context) + .block(); + } + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBSubscriptionInner createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + return createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 topicName, String subscriptionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, context).block(); + } + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, Context.NONE); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (subscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + subscriptionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, subscriptionName, context).block(); + } + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBSubscriptionInner get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + return getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByTopicNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTopicNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTopicNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsImpl.java new file mode 100644 index 000000000000..7e17a2ba847f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/SubscriptionsImpl.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.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.SubscriptionsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.azure.resourcemanager.servicebus.generated.models.SBSubscription; +import com.azure.resourcemanager.servicebus.generated.models.Subscriptions; + +public final class SubscriptionsImpl implements Subscriptions { + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionsImpl.class); + + private final SubscriptionsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public SubscriptionsImpl( + SubscriptionsClient innerClient, + com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByTopic(String resourceGroupName, String namespaceName, String topicName) { + PagedIterable inner = + this.serviceClient().listByTopic(resourceGroupName, namespaceName, topicName); + return Utils.mapPage(inner, inner1 -> new SBSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByTopic(resourceGroupName, namespaceName, topicName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new SBSubscriptionImpl(inner1, this.manager())); + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, namespaceName, topicName, subscriptionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBSubscription createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters) { + SBSubscriptionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, namespaceName, topicName, subscriptionName, parameters); + if (inner != null) { + return new SBSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, context); + } + + public void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + this.serviceClient().delete(resourceGroupName, namespaceName, topicName, subscriptionName); + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, topicName, subscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBSubscription get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { + SBSubscriptionInner inner = + this.serviceClient().get(resourceGroupName, namespaceName, topicName, subscriptionName); + if (inner != null) { + return new SBSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + private SubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsClientImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsClientImpl.java new file mode 100644 index 000000000000..06149b3d6065 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsClientImpl.java @@ -0,0 +1,2305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicebus.generated.fluent.TopicsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRuleListResult; +import com.azure.resourcemanager.servicebus.generated.models.SBTopicListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TopicsClient. */ +public final class TopicsClientImpl implements TopicsClient { + /** The proxy service used to perform REST calls. */ + private final TopicsService service; + + /** The service client containing this operation class. */ + private final ServiceBusManagementClientImpl client; + + /** + * Initializes an instance of TopicsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TopicsClientImpl(ServiceBusManagementClientImpl client) { + this.service = RestProxy.create(TopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceBusManagementClientTopics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceBusManagement") + public interface TopicsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBAuthorizationRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}" + + "/regenerateKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") Integer skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SBTopicInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus" + + "/namespaces/{namespaceName}/topics/{topicName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("topicName") String topicName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthorizationRules( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String topicName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName)); + } + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName, context)); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context) + .block(); + } + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBAuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAuthorizationRule( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 topicName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context) + .block(); + } + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, Context.NONE); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, context) + .block(); + } + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, topicName, authorizationRuleName, Context.NONE) + .getValue(); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (authorizationRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context) + .block(); + } + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace 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 topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace 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 topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top, context), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + final Integer skip = null; + final Integer top = null; + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top)); + } + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, topicName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, topicName, parameters, context) + .block(); + } + + /** + * Creates a topic in the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param parameters Parameters supplied to create a topic resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBTopicInner createOrUpdate( + String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, namespaceName, topicName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, String topicName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 topicName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, topicName, context).block(); + } + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName, String topicName) { + deleteWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String topicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (topicName == null) { + return Mono.error(new IllegalArgumentException("Parameter topicName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + topicName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String topicName) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, topicName, context).block(); + } + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SBTopicInner get(String resourceGroupName, String namespaceName, String topicName) { + return getWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Namespace operation 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Topics operation 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Topics operation 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsImpl.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsImpl.java new file mode 100644 index 000000000000..c688aa7912e2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/TopicsImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicebus.generated.fluent.TopicsClient; +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessKeys; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; +import com.azure.resourcemanager.servicebus.generated.models.SBAuthorizationRule; +import com.azure.resourcemanager.servicebus.generated.models.SBTopic; +import com.azure.resourcemanager.servicebus.generated.models.Topics; + +public final class TopicsImpl implements Topics { + private static final ClientLogger LOGGER = new ClientLogger(TopicsImpl.class); + + private final TopicsClient innerClient; + + private final com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager; + + public TopicsImpl( + TopicsClient innerClient, com.azure.resourcemanager.servicebus.generated.ServiceBusManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, topicName); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, topicName, context); + return Utils.mapPage(inner, inner1 -> new SBAuthorizationRuleImpl(inner1, this.manager())); + } + + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .createOrUpdateAuthorizationRule( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBAuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + SBAuthorizationRuleInner inner = + this + .serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName); + if (inner != null) { + return new SBAuthorizationRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, context); + } + + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + this + .serviceClient() + .deleteAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName); + } + + public Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context) { + Response inner = + this + .serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, topicName, authorizationRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys listKeys( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + AccessKeysInner inner = + this.serviceClient().listKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this + .serviceClient() + .regenerateKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new SBTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByNamespace(resourceGroupName, namespaceName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new SBTopicImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, topicName, context); + } + + public void delete(String resourceGroupName, String namespaceName, String topicName) { + this.serviceClient().delete(resourceGroupName, namespaceName, topicName); + } + + public Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, namespaceName, topicName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SBTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SBTopic get(String resourceGroupName, String namespaceName, String topicName) { + SBTopicInner inner = this.serviceClient().get(resourceGroupName, namespaceName, topicName); + if (inner != null) { + return new SBTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public SBTopic getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, topicName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + this.deleteWithResponse(resourceGroupName, namespaceName, topicName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String topicName = Utils.getValueFromIdByName(id, "topics"); + if (topicName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'topics'.", id))); + } + return this.deleteWithResponse(resourceGroupName, namespaceName, topicName, context); + } + + private TopicsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager() { + return this.serviceManager; + } + + public SBTopicImpl define(String name) { + return new SBTopicImpl(name, this.manager()); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/Utils.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/Utils.java new file mode 100644 index 000000000000..ec6fb7e7eeca --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/package-info.java new file mode 100644 index 000000000000..c375b9e95db8 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for ServiceBusManagementClient. Azure Service Bus client for managing + * Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.implementation; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessKeys.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessKeys.java new file mode 100644 index 000000000000..4b783e933dbe --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessKeys.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner; + +/** An immutable client-side representation of AccessKeys. */ +public interface AccessKeys { + /** + * Gets the primaryConnectionString property: Primary connection string of the created namespace authorization rule. + * + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * Gets the secondaryConnectionString property: Secondary connection string of the created namespace authorization + * rule. + * + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * Gets the aliasPrimaryConnectionString property: Primary connection string of the alias if GEO DR is enabled. + * + * @return the aliasPrimaryConnectionString value. + */ + String aliasPrimaryConnectionString(); + + /** + * Gets the aliasSecondaryConnectionString property: Secondary connection string of the alias if GEO DR is enabled. + * + * @return the aliasSecondaryConnectionString value. + */ + String aliasSecondaryConnectionString(); + + /** + * Gets the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the keyName property: A string that describes the authorization rule. + * + * @return the keyName value. + */ + String keyName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.AccessKeysInner object. + * + * @return the inner object. + */ + AccessKeysInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessRights.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessRights.java new file mode 100644 index 000000000000..473e889d98cc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/AccessRights.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AccessRights. */ +public enum AccessRights { + /** Enum value Manage. */ + MANAGE("Manage"), + + /** Enum value Send. */ + SEND("Send"), + + /** Enum value Listen. */ + LISTEN("Listen"); + + /** The actual serialized value for a AccessRights instance. */ + private final String value; + + AccessRights(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessRights instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessRights object, or null if unable to parse. + */ + @JsonCreator + public static AccessRights fromString(String value) { + if (value == null) { + return null; + } + AccessRights[] items = AccessRights.values(); + for (AccessRights item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Action.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Action.java new file mode 100644 index 000000000000..15ecf9a4f67a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Action.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the filter actions which are allowed for the transformation of a message that have been matched by a + * filter expression. + */ +@Fluent +public class Action { + /* + * SQL expression. e.g. MyProperty='ABC' + */ + @JsonProperty(value = "sqlExpression") + private String sqlExpression; + + /* + * This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded + * to 20. + */ + @JsonProperty(value = "compatibilityLevel") + private Integer compatibilityLevel; + + /* + * Value that indicates whether the rule action requires preprocessing. + */ + @JsonProperty(value = "requiresPreprocessing") + private Boolean requiresPreprocessing; + + /** Creates an instance of Action class. */ + public Action() { + } + + /** + * Get the sqlExpression property: SQL expression. e.g. MyProperty='ABC'. + * + * @return the sqlExpression value. + */ + public String sqlExpression() { + return this.sqlExpression; + } + + /** + * Set the sqlExpression property: SQL expression. e.g. MyProperty='ABC'. + * + * @param sqlExpression the sqlExpression value to set. + * @return the Action object itself. + */ + public Action withSqlExpression(String sqlExpression) { + this.sqlExpression = sqlExpression; + return this; + } + + /** + * Get the compatibilityLevel property: This property is reserved for future use. An integer value showing the + * compatibility level, currently hard-coded to 20. + * + * @return the compatibilityLevel value. + */ + public Integer compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set the compatibilityLevel property: This property is reserved for future use. An integer value showing the + * compatibility level, currently hard-coded to 20. + * + * @param compatibilityLevel the compatibilityLevel value to set. + * @return the Action object itself. + */ + public Action withCompatibilityLevel(Integer compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value. + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @param requiresPreprocessing the requiresPreprocessing value to set. + * @return the Action object itself. + */ + public Action withRequiresPreprocessing(Boolean requiresPreprocessing) { + this.requiresPreprocessing = requiresPreprocessing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecovery.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecovery.java new file mode 100644 index 000000000000..ac60c65d2f70 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecovery.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; + +/** An immutable client-side representation of ArmDisasterRecovery. */ +public interface ArmDisasterRecovery { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the 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 pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * Gets the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO + * DR pairing. + * + * @return the partnerNamespace value. + */ + String partnerNamespace(); + + /** + * Gets the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the alternateName value. + */ + String alternateName(); + + /** + * Gets the role property: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or + * 'Secondary'. + * + * @return the role value. + */ + RoleDisasterRecovery role(); + + /** + * Gets the 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner object. + * + * @return the inner object. + */ + ArmDisasterRecoveryInner innerModel(); + + /** The entirety of the ArmDisasterRecovery definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ArmDisasterRecovery definition stages. */ + interface DefinitionStages { + /** The first stage of the ArmDisasterRecovery definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ArmDisasterRecovery definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + /** + * The stage of the ArmDisasterRecovery definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithPartnerNamespace, DefinitionStages.WithAlternateName { + /** + * Executes the create request. + * + * @return the created resource. + */ + ArmDisasterRecovery create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ArmDisasterRecovery create(Context context); + } + /** The stage of the ArmDisasterRecovery definition allowing to specify partnerNamespace. */ + interface WithPartnerNamespace { + /** + * Specifies the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which + * is part of GEO DR pairing. + * + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * @return the next definition stage. + */ + WithCreate withPartnerNamespace(String partnerNamespace); + } + /** The stage of the ArmDisasterRecovery definition allowing to specify alternateName. */ + interface WithAlternateName { + /** + * Specifies the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * + * @param alternateName Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * @return the next definition stage. + */ + WithCreate withAlternateName(String alternateName); + } + } + /** + * Begins update for the ArmDisasterRecovery resource. + * + * @return the stage of resource update. + */ + ArmDisasterRecovery.Update update(); + + /** The template for ArmDisasterRecovery update. */ + interface Update extends UpdateStages.WithPartnerNamespace, UpdateStages.WithAlternateName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ArmDisasterRecovery apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ArmDisasterRecovery apply(Context context); + } + /** The ArmDisasterRecovery update stages. */ + interface UpdateStages { + /** The stage of the ArmDisasterRecovery update allowing to specify partnerNamespace. */ + interface WithPartnerNamespace { + /** + * Specifies the partnerNamespace property: ARM Id of the Primary/Secondary eventhub namespace name, which + * is part of GEO DR pairing. + * + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * @return the next definition stage. + */ + Update withPartnerNamespace(String partnerNamespace); + } + /** The stage of the ArmDisasterRecovery update allowing to specify alternateName. */ + interface WithAlternateName { + /** + * Specifies the alternateName property: Primary/Secondary eventhub namespace name, which is part of GEO DR + * pairing. + * + * @param alternateName Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * @return the next definition stage. + */ + Update withAlternateName(String alternateName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ArmDisasterRecovery refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ArmDisasterRecovery refresh(Context context); + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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(); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response failOverWithResponse(FailoverProperties parameters, 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(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecoveryListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecoveryListResult.java new file mode 100644 index 000000000000..67572ff66ff3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ArmDisasterRecoveryListResult.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.ArmDisasterRecoveryInner; +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 { + /* + * 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; + + /** Creates an instance of ArmDisasterRecoveryListResult class. */ + public ArmDisasterRecoveryListResult() { + } + + /** + * Get the value property: List of Alias(Disaster Recovery configurations). + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Alias(Disaster Recovery configurations). + * + * @param value the value value to set. + * @return the ArmDisasterRecoveryListResult object itself. + */ + public ArmDisasterRecoveryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Alias(Disaster Recovery configuration). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailability.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailability.java new file mode 100644 index 000000000000..12edafa3406f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailability.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a Check Name availability request properties. */ +@Fluent +public final class CheckNameAvailability { + /* + * The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and + * hyphens. The namespace must start with a letter, and it must end with a letter or number. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** Creates an instance of CheckNameAvailability class. */ + public CheckNameAvailability() { + } + + /** + * Get the name property: The Name to check the namespace name availability and The namespace name can contain only + * letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Name to check the namespace name availability and The namespace name can contain only + * letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * + * @param name the name value to set. + * @return the CheckNameAvailability object itself. + */ + public CheckNameAvailability withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckNameAvailability")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailability.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailabilityResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..b13f229db8f0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CheckNameAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the message property: The detailed info regarding the reason associated with the namespace. + * + * @return the message value. + */ + String message(); + + /** + * Gets the nameAvailable property: Value indicating namespace is availability, true if the namespace is available; + * otherwise, false. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason for unavailability of a namespace. + * + * @return the reason value. + */ + UnavailableReason reason(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.CheckNameAvailabilityResultInner + * object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ConnectionState.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ConnectionState.java new file mode 100644 index 000000000000..a3cc77323de4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ConnectionState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ConnectionState information. */ +@Fluent +public final class ConnectionState { + /* + * Status of the connection. + */ + @JsonProperty(value = "status") + private PrivateLinkConnectionStatus status; + + /* + * Description of the connection state. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of ConnectionState class. */ + public ConnectionState() { + } + + /** + * Get the status property: Status of the connection. + * + * @return the status value. + */ + public PrivateLinkConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the connection. + * + * @param status the status value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withStatus(PrivateLinkConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: Description of the connection state. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the connection state. + * + * @param description the description value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CorrelationFilter.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CorrelationFilter.java new file mode 100644 index 000000000000..ecdc4dd6f149 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/CorrelationFilter.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents the correlation filter expression. */ +@Fluent +public final class CorrelationFilter { + /* + * dictionary object for custom filters + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /* + * Identifier of the correlation. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Identifier of the message. + */ + @JsonProperty(value = "messageId") + private String messageId; + + /* + * Address to send to. + */ + @JsonProperty(value = "to") + private String to; + + /* + * Address of the queue to reply to. + */ + @JsonProperty(value = "replyTo") + private String replyTo; + + /* + * Application specific label. + */ + @JsonProperty(value = "label") + private String label; + + /* + * Session identifier. + */ + @JsonProperty(value = "sessionId") + private String sessionId; + + /* + * Session identifier to reply to. + */ + @JsonProperty(value = "replyToSessionId") + private String replyToSessionId; + + /* + * Content type of the message. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * Value that indicates whether the rule action requires preprocessing. + */ + @JsonProperty(value = "requiresPreprocessing") + private Boolean requiresPreprocessing; + + /** Creates an instance of CorrelationFilter class. */ + public CorrelationFilter() { + } + + /** + * Get the properties property: dictionary object for custom filters. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: dictionary object for custom filters. + * + * @param properties the properties value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the correlationId property: Identifier of the correlation. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Identifier of the correlation. + * + * @param correlationId the correlationId value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the messageId property: Identifier of the message. + * + * @return the messageId value. + */ + public String messageId() { + return this.messageId; + } + + /** + * Set the messageId property: Identifier of the message. + * + * @param messageId the messageId value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withMessageId(String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Get the to property: Address to send to. + * + * @return the to value. + */ + public String to() { + return this.to; + } + + /** + * Set the to property: Address to send to. + * + * @param to the to value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withTo(String to) { + this.to = to; + return this; + } + + /** + * Get the replyTo property: Address of the queue to reply to. + * + * @return the replyTo value. + */ + public String replyTo() { + return this.replyTo; + } + + /** + * Set the replyTo property: Address of the queue to reply to. + * + * @param replyTo the replyTo value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withReplyTo(String replyTo) { + this.replyTo = replyTo; + return this; + } + + /** + * Get the label property: Application specific label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Application specific label. + * + * @param label the label value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the sessionId property: Session identifier. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set the sessionId property: Session identifier. + * + * @param sessionId the sessionId value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get the replyToSessionId property: Session identifier to reply to. + * + * @return the replyToSessionId value. + */ + public String replyToSessionId() { + return this.replyToSessionId; + } + + /** + * Set the replyToSessionId property: Session identifier to reply to. + * + * @param replyToSessionId the replyToSessionId value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withReplyToSessionId(String replyToSessionId) { + this.replyToSessionId = replyToSessionId; + return this; + } + + /** + * Get the contentType property: Content type of the message. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Content type of the message. + * + * @param contentType the contentType value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value. + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @param requiresPreprocessing the requiresPreprocessing value to set. + * @return the CorrelationFilter object itself. + */ + public CorrelationFilter withRequiresPreprocessing(Boolean requiresPreprocessing) { + this.requiresPreprocessing = requiresPreprocessing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DefaultAction.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DefaultAction.java new file mode 100644 index 000000000000..3c04b8bb0348 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DefaultAction.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Default Action for Network Rule Set. */ +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); + } + + /** + * Gets known DefaultAction values. + * + * @return known DefaultAction values. + */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DisasterRecoveryConfigs.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DisasterRecoveryConfigs.java new file mode 100644 index 000000000000..188e0b00ebb1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/DisasterRecoveryConfigs.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DisasterRecoveryConfigs. */ +public interface DisasterRecoveryConfigs { + /** + * 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) as paginated response with {@link PagedIterable}. + */ + 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) as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response failOverWithResponse( + String resourceGroupName, String namespaceName, String alias, FailoverProperties parameters, 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); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String alias, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name along with {@link Response}. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param alias The Disaster Recovery configuration name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * Gets 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); + + /** + * 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); + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters, Context context); + + /** + * Check the give namespace name availability. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String namespaceName, CheckNameAvailability parameters); + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Encryption.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Encryption.java new file mode 100644 index 000000000000..7549474af5ef --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Encryption.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties to configure Encryption. */ +@Fluent +public final class Encryption { + /* + * 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; + + /** Creates an instance of Encryption class. */ + public Encryption() { + } + + /** + * Get the keyVaultProperties property: Properties of KeyVault. + * + * @return the keyVaultProperties value. + */ + public List keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Properties of KeyVault. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(List keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the keySource property: Enumerates the possible value of keySource for Encryption. + * + * @return the keySource value. + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: Enumerates the possible value of keySource for Encryption. + * + * @param keySource the keySource value to set. + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: Enable Infrastructure Encryption (Double Encryption). + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: Enable Infrastructure Encryption (Double Encryption). + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EndPointProvisioningState.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EndPointProvisioningState.java new file mode 100644 index 000000000000..a60c5a8efb3a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EndPointProvisioningState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the Private Endpoint Connection. */ +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); + } + + /** + * Gets known EndPointProvisioningState values. + * + * @return known EndPointProvisioningState values. + */ + public static Collection values() { + return values(EndPointProvisioningState.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EntityStatus.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EntityStatus.java new file mode 100644 index 000000000000..9bcf8db52906 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/EntityStatus.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Entity status. */ +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) { + if (value == null) { + return null; + } + EntityStatus[] items = EntityStatus.values(); + for (EntityStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FailoverProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FailoverProperties.java new file mode 100644 index 000000000000..1f3d5ac6407e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FailoverProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.FailoverPropertiesProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Safe failover is to indicate the service should wait for pending replication to finish before switching to the + * secondary. + */ +@Fluent +public final class FailoverProperties { + /* + * Safe failover is to indicate the service should wait for pending replication to finish before switching to the + * secondary. + */ + @JsonProperty(value = "properties") + private FailoverPropertiesProperties innerProperties; + + /** Creates an instance of FailoverProperties class. */ + public FailoverProperties() { + } + + /** + * Get the innerProperties property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @return the innerProperties value. + */ + private FailoverPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the isSafeFailover property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @return the isSafeFailover value. + */ + public Boolean isSafeFailover() { + return this.innerProperties() == null ? null : this.innerProperties().isSafeFailover(); + } + + /** + * Set the isSafeFailover property: Safe failover is to indicate the service should wait for pending replication to + * finish before switching to the secondary. + * + * @param isSafeFailover the isSafeFailover value to set. + * @return the FailoverProperties object itself. + */ + public FailoverProperties withIsSafeFailover(Boolean isSafeFailover) { + if (this.innerProperties() == null) { + this.innerProperties = new FailoverPropertiesProperties(); + } + this.innerProperties().withIsSafeFailover(isSafeFailover); + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FilterType.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FilterType.java new file mode 100644 index 000000000000..5515dc59184e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/FilterType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Rule filter types. */ +public enum FilterType { + /** Enum value SqlFilter. */ + SQL_FILTER("SqlFilter"), + + /** Enum value CorrelationFilter. */ + CORRELATION_FILTER("CorrelationFilter"); + + /** The actual serialized value for a FilterType instance. */ + private final String value; + + FilterType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FilterType instance. + * + * @param value the serialized value to parse. + * @return the parsed FilterType object, or null if unable to parse. + */ + @JsonCreator + public static FilterType fromString(String value) { + if (value == null) { + return null; + } + FilterType[] items = FilterType.values(); + for (FilterType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Identity.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Identity.java new file mode 100644 index 000000000000..7ea5af16caca --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Identity.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties to configure User Assigned Identities for Bring your Own Keys. */ +@Fluent +public class Identity { + /* + * 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; + + /** Creates an instance of Identity class. */ + public Identity() { + } + + /** + * Get the principalId property: ObjectId from the KeyVault. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: TenantId from the KeyVault. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Properties for User Assigned Identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Properties for User Assigned Identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeySource.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeySource.java new file mode 100644 index 000000000000..cac21e49680b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeySource.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Enumerates the possible value of keySource for Encryption. */ +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) { + if (value == null) { + return null; + } + KeySource[] items = KeySource.values(); + for (KeySource item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyType.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyType.java new file mode 100644 index 000000000000..b5e552053312 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The access key to regenerate. */ +public enum KeyType { + /** Enum value PrimaryKey. */ + PRIMARY_KEY("PrimaryKey"), + + /** Enum value SecondaryKey. */ + SECONDARY_KEY("SecondaryKey"); + + /** The actual serialized value for a KeyType instance. */ + private final String value; + + KeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyType object, or null if unable to parse. + */ + @JsonCreator + public static KeyType fromString(String value) { + if (value == null) { + return null; + } + KeyType[] items = KeyType.values(); + for (KeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyVaultProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyVaultProperties.java new file mode 100644 index 000000000000..3b6277b0a74b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/KeyVaultProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties to configure keyVault Properties. */ +@Fluent +public final class KeyVaultProperties { + /* + * Name of the Key from KeyVault + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * Uri of KeyVault + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /* + * Version of KeyVault + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private UserAssignedIdentityProperties identity; + + /** Creates an instance of KeyVaultProperties class. */ + public KeyVaultProperties() { + } + + /** + * Get the keyName property: Name of the Key from KeyVault. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Name of the Key from KeyVault. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVaultUri property: Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the keyVersion property: Version of KeyVault. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: Version of KeyVault. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public UserAssignedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentity(UserAssignedIdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ManagedServiceIdentityType.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..5de01c1db62d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ManagedServiceIdentityType.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.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Type of managed service identity. */ +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) { + if (value == null) { + return null; + } + ManagedServiceIdentityType[] items = ManagedServiceIdentityType.values(); + for (ManagedServiceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MessageCountDetails.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MessageCountDetails.java new file mode 100644 index 000000000000..ae4660fd7e82 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MessageCountDetails.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Message Count Details. */ +@Immutable +public final class MessageCountDetails { + /* + * Number of active messages in the queue, topic, or subscription. + */ + @JsonProperty(value = "activeMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long activeMessageCount; + + /* + * Number of messages that are dead lettered. + */ + @JsonProperty(value = "deadLetterMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long deadLetterMessageCount; + + /* + * Number of scheduled messages. + */ + @JsonProperty(value = "scheduledMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long scheduledMessageCount; + + /* + * Number of messages transferred to another queue, topic, or subscription. + */ + @JsonProperty(value = "transferMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transferMessageCount; + + /* + * Number of messages transferred into dead letters. + */ + @JsonProperty(value = "transferDeadLetterMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transferDeadLetterMessageCount; + + /** Creates an instance of MessageCountDetails class. */ + public MessageCountDetails() { + } + + /** + * Get the activeMessageCount property: Number of active messages in the queue, topic, or subscription. + * + * @return the activeMessageCount value. + */ + public Long activeMessageCount() { + return this.activeMessageCount; + } + + /** + * Get the deadLetterMessageCount property: Number of messages that are dead lettered. + * + * @return the deadLetterMessageCount value. + */ + public Long deadLetterMessageCount() { + return this.deadLetterMessageCount; + } + + /** + * Get the scheduledMessageCount property: Number of scheduled messages. + * + * @return the scheduledMessageCount value. + */ + public Long scheduledMessageCount() { + return this.scheduledMessageCount; + } + + /** + * Get the transferMessageCount property: Number of messages transferred to another queue, topic, or subscription. + * + * @return the transferMessageCount value. + */ + public Long transferMessageCount() { + return this.transferMessageCount; + } + + /** + * Get the transferDeadLetterMessageCount property: Number of messages transferred into dead letters. + * + * @return the transferDeadLetterMessageCount value. + */ + public Long transferDeadLetterMessageCount() { + return this.transferDeadLetterMessageCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigListResult.java new file mode 100644 index 000000000000..867ebf2d4a0f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the List migrationConfigurations operation. */ +@Fluent +public final class MigrationConfigListResult { + /* + * List of Migration Configs + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete list of migrationConfigurations + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of MigrationConfigListResult class. */ + public MigrationConfigListResult() { + } + + /** + * Get the value property: List of Migration Configs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Migration Configs. + * + * @param value the value value to set. + * @return the MigrationConfigListResult object itself. + */ + public MigrationConfigListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * migrationConfigurations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigProperties.java new file mode 100644 index 000000000000..ab916a04f67e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner; + +/** An immutable client-side representation of MigrationConfigProperties. */ +public interface MigrationConfigProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the provisioningState property: Provisioning state of Migration Configuration. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the pendingReplicationOperationsCount property: Number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * Gets the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * + * @return the targetNamespace value. + */ + String targetNamespace(); + + /** + * Gets the postMigrationName property: Name to access Standard Namespace after migration. + * + * @return the postMigrationName value. + */ + String postMigrationName(); + + /** + * Gets the migrationState property: State in which Standard to Premium Migration is, possible values : Unknown, + * Reverting, Completing, Initiating, Syncing, Active. + * + * @return the migrationState value. + */ + String migrationState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.MigrationConfigPropertiesInner + * object. + * + * @return the inner object. + */ + MigrationConfigPropertiesInner innerModel(); + + /** The entirety of the MigrationConfigProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The MigrationConfigProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the MigrationConfigProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the MigrationConfigProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + /** + * The stage of the MigrationConfigProperties definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTargetNamespace, DefinitionStages.WithPostMigrationName { + /** + * Executes the create request. + * + * @return the created resource. + */ + MigrationConfigProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MigrationConfigProperties create(Context context); + } + /** The stage of the MigrationConfigProperties definition allowing to specify targetNamespace. */ + interface WithTargetNamespace { + /** + * Specifies the targetNamespace property: Existing premium Namespace ARM Id name which has no entities, + * will be used for migration. + * + * @param targetNamespace Existing premium Namespace ARM Id name which has no entities, will be used for + * migration. + * @return the next definition stage. + */ + WithCreate withTargetNamespace(String targetNamespace); + } + /** The stage of the MigrationConfigProperties definition allowing to specify postMigrationName. */ + interface WithPostMigrationName { + /** + * Specifies the postMigrationName property: Name to access Standard Namespace after migration. + * + * @param postMigrationName Name to access Standard Namespace after migration. + * @return the next definition stage. + */ + WithCreate withPostMigrationName(String postMigrationName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MigrationConfigProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MigrationConfigProperties refresh(Context context); + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 completeMigrationWithResponse(Context context); + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void completeMigration(); + + /** + * This operation reverts Migration. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response revertWithResponse(Context context); + + /** + * This operation reverts Migration. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigs.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigs.java new file mode 100644 index 000000000000..7b5691abbe0f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigs.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MigrationConfigs. */ +public interface MigrationConfigs { + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets all migrationConfigurations. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all migrationConfigurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, MigrationConfigurationName configName, Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * Retrieves Migration Config. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation. + */ + MigrationConfigProperties get( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response completeMigrationWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * This operation Completes Migration of entities by pointing the connection strings to Premium namespace and any + * entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void completeMigration(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response revertWithResponse( + String resourceGroupName, String namespaceName, MigrationConfigurationName configName, Context context); + + /** + * This operation reverts Migration. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param configName The configuration name. Should always be "$default". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(String resourceGroupName, String namespaceName, MigrationConfigurationName configName); + + /** + * Retrieves Migration Config. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response}. + */ + MigrationConfigProperties getById(String id); + + /** + * Retrieves Migration Config. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single item in List or Get Migration Config operation along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a MigrationConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a MigrationConfiguration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MigrationConfigProperties resource. + * + * @param name resource name. + * @return the first stage of the new MigrationConfigProperties definition. + */ + MigrationConfigProperties.DefinitionStages.Blank define(MigrationConfigurationName name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigurationName.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigurationName.java new file mode 100644 index 000000000000..2bba469f470b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/MigrationConfigurationName.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationConfigurationName. */ +public final class MigrationConfigurationName extends ExpandableStringEnum { + /** Static value $default for MigrationConfigurationName. */ + public static final MigrationConfigurationName DEFAULT = fromString("$default"); + + /** + * Creates or finds a MigrationConfigurationName from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationConfigurationName. + */ + @JsonCreator + public static MigrationConfigurationName fromString(String name) { + return fromString(name, MigrationConfigurationName.class); + } + + /** + * Gets known MigrationConfigurationName values. + * + * @return known MigrationConfigurationName values. + */ + public static Collection values() { + return values(MigrationConfigurationName.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetIpRules.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetIpRules.java new file mode 100644 index 000000000000..1c0ed708feea --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetIpRules.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of NetWorkRuleSet - IpRules resource. */ +@Fluent +public final class NWRuleSetIpRules { + /* + * IP Mask + */ + @JsonProperty(value = "ipMask") + private String ipMask; + + /* + * The IP Filter Action + */ + @JsonProperty(value = "action") + private NetworkRuleIpAction action; + + /** Creates an instance of NWRuleSetIpRules class. */ + public NWRuleSetIpRules() { + } + + /** + * Get the ipMask property: IP Mask. + * + * @return the ipMask value. + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set the ipMask property: IP Mask. + * + * @param ipMask the ipMask value to set. + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get the action property: The IP Filter Action. + * + * @return the action value. + */ + public NetworkRuleIpAction action() { + return this.action; + } + + /** + * Set the action property: The IP Filter Action. + * + * @param action the action value to set. + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withAction(NetworkRuleIpAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetVirtualNetworkRules.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetVirtualNetworkRules.java new file mode 100644 index 000000000000..892a2a127d7f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NWRuleSetVirtualNetworkRules.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of VirtualNetworkRules - NetworkRules resource. */ +@Fluent +public final class NWRuleSetVirtualNetworkRules { + /* + * Subnet properties + */ + @JsonProperty(value = "subnet") + private Subnet subnet; + + /* + * Value that indicates whether to ignore missing VNet Service Endpoint + */ + @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** Creates an instance of NWRuleSetVirtualNetworkRules class. */ + public NWRuleSetVirtualNetworkRules() { + } + + /** + * Get the subnet property: Subnet properties. + * + * @return the subnet value. + */ + public Subnet subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet properties. + * + * @param subnet the subnet value to set. + * @return the NWRuleSetVirtualNetworkRules object itself. + */ + public NWRuleSetVirtualNetworkRules withSubnet(Subnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the ignoreMissingVnetServiceEndpoint property: Value that indicates whether to ignore missing VNet Service + * Endpoint. + * + * @return the ignoreMissingVnetServiceEndpoint value. + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set the ignoreMissingVnetServiceEndpoint property: Value that indicates whether to ignore missing VNet Service + * Endpoint. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. + * @return the NWRuleSetVirtualNetworkRules object itself. + */ + public NWRuleSetVirtualNetworkRules withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Namespaces.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Namespaces.java new file mode 100644 index 000000000000..e6072a817ace --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Namespaces.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; + +/** Resource collection API of Namespaces. */ +public interface Namespaces { + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available namespaces within the subscription, irrespective of the resource groups as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the available namespaces within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available namespaces within a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, Context context); + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets a description for the specified namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace. + */ + SBNamespace getByResourceGroup(String resourceGroupName, String namespaceName); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource along with {@link Response}. + */ + Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context); + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of NetworkRuleSet resource. + */ + NetworkRuleSet createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName); + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName); + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetworkRuleSet for a Namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listNetworkRuleSets(String resourceGroupName, String namespaceName, Context context); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + + /** + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name along with {@link Response}. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets 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); + + /** + * 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); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context); + + /** + * Check the give namespace name availability. + * + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability request properties. + */ + CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters); + + /** + * Gets a description for the specified namespace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace along with {@link Response}. + */ + SBNamespace getById(String id); + + /** + * Gets a description for the specified namespace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified namespace along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name along with {@link Response}. + */ + SBAuthorizationRule getAuthorizationRuleById(String id); + + /** + * Gets an authorization rule for a namespace by rule name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a namespace by rule name 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 a namespace authorization rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRuleById(String id); + + /** + * Deletes a namespace authorization rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SBNamespace resource. + * + * @param name resource name. + * @return the first stage of the new SBNamespace definition. + */ + SBNamespace.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new SBAuthorizationRule resource. + * + * @param name resource name. + * @return the first stage of the new SBAuthorizationRule definition. + */ + SBAuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleIpAction.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleIpAction.java new file mode 100644 index 000000000000..2f043d27506b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleIpAction.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The IP Filter Action. */ +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); + } + + /** + * Gets known NetworkRuleIpAction values. + * + * @return known NetworkRuleIpAction values. + */ + public static Collection values() { + return values(NetworkRuleIpAction.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSet.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSet.java new file mode 100644 index 000000000000..76ae49c329b1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import java.util.List; + +/** An immutable client-side representation of NetworkRuleSet. */ +public interface NetworkRuleSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the 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.servicebus.generated.fluent.models.NetworkRuleSetInner object. + * + * @return the inner object. + */ + NetworkRuleSetInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSetListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSetListResult.java new file mode 100644 index 000000000000..8d5cdf35a508 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/NetworkRuleSetListResult.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List NetworkRuleSet operation. */ +@Fluent +public final class NetworkRuleSetListResult { + /* + * 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; + + /** Creates an instance of NetworkRuleSetListResult class. */ + public NetworkRuleSetListResult() { + } + + /** + * Get the value property: Result of the List NetworkRuleSet operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List NetworkRuleSet operation. + * + * @param value the value value to set. + * @return the NetworkRuleSetListResult object itself. + */ + public NetworkRuleSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + * + * @param nextLink the nextLink value to set. + * @return the NetworkRuleSetListResult object itself. + */ + public NetworkRuleSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operation.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operation.java new file mode 100644 index 000000000000..25b113b75b0e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the 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.servicebus.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationDisplay.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationDisplay.java new file mode 100644 index 000000000000..627981137c40 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Immutable +public final class OperationDisplay { + /* + * 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; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationListResult.java new file mode 100644 index 000000000000..91b0c7efe378 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.servicebus.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list ServiceBus operations. It contains a list of operations and a URL link to get the next + * set of results. + */ +@Immutable +public final class OperationListResult { + /* + * List of ServiceBus operations supported by the Microsoft.ServiceBus resource provider. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of ServiceBus operations supported by the Microsoft.ServiceBus resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operations.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operations.java new file mode 100644 index 000000000000..dfeae5813b25 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available ServiceBus REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available ServiceBus REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list ServiceBus operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpoint.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpoint.java new file mode 100644 index 000000000000..5a5bd3d41a2b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpoint.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpoint information. */ +@Fluent +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM identifier for Private Endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnection.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..21237063e257 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; + +/** 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, + DefinitionStages.WithPrivateLinkServiceConnectionState, + DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The Private Endpoint resource for this Connection.. + * + * @param privateEndpoint The Private Endpoint resource for this Connection. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Details about the state of the connection.. + * + * @param privateLinkServiceConnectionState Details about the state of the connection. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + WithCreate withProvisioningState(EndPointProvisioningState provisioningState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update + extends UpdateStages.WithPrivateEndpoint, + UpdateStages.WithPrivateLinkServiceConnectionState, + UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The Private Endpoint resource for this Connection.. + * + * @param privateEndpoint The Private Endpoint resource for this Connection. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Details about the state of the connection.. + * + * @param privateLinkServiceConnectionState Details about the state of the connection. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + /** The stage of the PrivateEndpointConnection update allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + Update withProvisioningState(EndPointProvisioningState provisioningState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnectionListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..cbe6cf494799 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +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 { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: A collection of private endpoint connection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private endpoint connection resources. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of private endpoint connection resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of private endpoint connection resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnections.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..ded90daa2558 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available PrivateEndpointConnections within a namespace as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param 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 along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a description for the specified Private Endpoint Connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing Private Endpoint Connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkConnectionStatus.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkConnectionStatus.java new file mode 100644 index 000000000000..fcd58d4fee32 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkConnectionStatus.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the connection. */ +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); + } + + /** + * Gets known PrivateLinkConnectionStatus values. + * + * @return known PrivateLinkConnectionStatus values. + */ + public static Collection values() { + return values(PrivateLinkConnectionStatus.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResource.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResource.java new file mode 100644 index 000000000000..198279569800 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information of the private link resource. */ +@Fluent +public final class PrivateLinkResource { + /* + * 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; + + /** Creates an instance of PrivateLinkResource class. */ + public PrivateLinkResource() { + } + + /** + * 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 groupId property. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Set the groupId property: The groupId property. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withGroupId(String groupId) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the requiredMembers property: Required Members. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Set the requiredMembers property: Required Members. + * + * @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: Required Zone Names. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: Required Zone Names. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + 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/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResources.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResources.java new file mode 100644 index 000000000000..8d4c68750ce4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Gets lists of resources that supports Privatelinks. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResourcesListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResourcesListResult.java new file mode 100644 index 000000000000..39bc1bfe18e1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PrivateLinkResourcesListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourcesListResult. */ +public interface PrivateLinkResourcesListResult { + /** + * Gets the value property: A collection of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: A link for the next page of private link resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateLinkResourcesListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourcesListResultInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ProvisioningStateDR.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ProvisioningStateDR.java new file mode 100644 index 000000000000..244584f70ad4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ProvisioningStateDR.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.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or + * 'Failed'. + */ +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) { + if (value == null) { + return null; + } + ProvisioningStateDR[] items = ProvisioningStateDR.values(); + for (ProvisioningStateDR item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccess.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..254b88818bc7 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccess.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.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This determines if traffic is allowed over public network. By default it is enabled. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** Static value SecuredByPerimeter for PublicNetworkAccess. */ + public static final PublicNetworkAccess SECURED_BY_PERIMETER = fromString("SecuredByPerimeter"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccessFlag.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccessFlag.java new file mode 100644 index 000000000000..22ba6a65950c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/PublicNetworkAccessFlag.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This determines if traffic is allowed over public network. By default it is enabled. */ +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); + } + + /** + * Gets known PublicNetworkAccessFlag values. + * + * @return known PublicNetworkAccessFlag values. + */ + public static Collection values() { + return values(PublicNetworkAccessFlag.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Queues.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Queues.java new file mode 100644 index 000000000000..27e4cfb9b978 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Queues.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; + +/** Resource collection API of Queues. */ +public interface Queues { + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName); + + /** + * Gets all authorization rules for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorization rules for a queue as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * Creates an authorization rule for a queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * Deletes a queue authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name along with {@link Response}. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * Gets an authorization rule for a queue by rule name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authorization rule for a queue by rule name. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + Context context); + + /** + * Primary and secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys listKeys(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName); + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Regenerates the primary or secondary connection strings to the queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String queueName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets the queues within a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queues within a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 queueName, Context context); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String queueName); + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String queueName, Context context); + + /** + * Returns a description for the specified queue. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param queueName The queue name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource. + */ + SBQueue get(String resourceGroupName, String namespaceName, String queueName); + + /** + * Returns a description for the specified queue. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + SBQueue getById(String id); + + /** + * Returns a description for the specified queue. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of queue Resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a queue from the specified namespace in a resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SBQueue resource. + * + * @param name resource name. + * @return the first stage of the new SBQueue definition. + */ + SBQueue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RegenerateAccessKeyParameters.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RegenerateAccessKeyParameters.java new file mode 100644 index 000000000000..256dd3ff1a1a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RegenerateAccessKeyParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. */ +@Fluent +public final class RegenerateAccessKeyParameters { + /* + * The access key to regenerate. + */ + @JsonProperty(value = "keyType", required = true) + private KeyType keyType; + + /* + * Optional, if the key value provided, is reset for KeyType value or autogenerate Key value set for keyType + */ + @JsonProperty(value = "key") + private String key; + + /** Creates an instance of RegenerateAccessKeyParameters class. */ + public RegenerateAccessKeyParameters() { + } + + /** + * Get the keyType property: The access key to regenerate. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The access key to regenerate. + * + * @param keyType the keyType value to set. + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get the key property: Optional, if the key value provided, is reset for KeyType value or autogenerate Key value + * set for keyType. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Optional, if the key value provided, is reset for KeyType value or autogenerate Key value + * set for keyType. + * + * @param key the key value to set. + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model RegenerateAccessKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateAccessKeyParameters.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ResourceNamespacePatch.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ResourceNamespacePatch.java new file mode 100644 index 000000000000..f2a6e01ab80b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/ResourceNamespacePatch.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Resource definition. */ +@Fluent +public class ResourceNamespacePatch extends ProxyResource { + /* + * Resource location + */ + @JsonProperty(value = "location") + private String location; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ResourceNamespacePatch class. */ + public ResourceNamespacePatch() { + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the ResourceNamespacePatch object itself. + */ + public ResourceNamespacePatch withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ResourceNamespacePatch object itself. + */ + public ResourceNamespacePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RoleDisasterRecovery.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RoleDisasterRecovery.java new file mode 100644 index 000000000000..4a4b2e90d5a8 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RoleDisasterRecovery.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. */ +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) { + if (value == null) { + return null; + } + RoleDisasterRecovery[] items = RoleDisasterRecovery.values(); + for (RoleDisasterRecovery item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rule.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rule.java new file mode 100644 index 000000000000..8cf84a5546e1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rule.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; + +/** An immutable client-side representation of Rule. */ +public interface Rule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the action property: Represents the filter actions which are allowed for the transformation of a message + * that have been matched by a filter expression. + * + * @return the action value. + */ + Action action(); + + /** + * Gets the filterType property: Filter type that is evaluated against a BrokeredMessage. + * + * @return the filterType value. + */ + FilterType filterType(); + + /** + * Gets the sqlFilter property: Properties of sqlFilter. + * + * @return the sqlFilter value. + */ + SqlFilter sqlFilter(); + + /** + * Gets the correlationFilter property: Properties of correlationFilter. + * + * @return the correlationFilter value. + */ + CorrelationFilter correlationFilter(); + + /** + * Gets the 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner object. + * + * @return the inner object. + */ + RuleInner innerModel(); + + /** The entirety of the Rule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + /** The Rule definition stages. */ + interface DefinitionStages { + /** The first stage of the Rule definition. */ + interface Blank extends WithResourceGroup { + } + /** The stage of the Rule definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName, namespaceName, topicName, subscriptionName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + } + /** + * The stage of the Rule definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithAction, + DefinitionStages.WithFilterType, + DefinitionStages.WithSqlFilter, + DefinitionStages.WithCorrelationFilter { + /** + * Executes the create request. + * + * @return the created resource. + */ + Rule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Rule create(Context context); + } + /** The stage of the Rule definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: Represents the filter actions which are allowed for the transformation of + * a message that have been matched by a filter expression.. + * + * @param action Represents the filter actions which are allowed for the transformation of a message that + * have been matched by a filter expression. + * @return the next definition stage. + */ + WithCreate withAction(Action action); + } + /** The stage of the Rule definition allowing to specify filterType. */ + interface WithFilterType { + /** + * Specifies the filterType property: Filter type that is evaluated against a BrokeredMessage.. + * + * @param filterType Filter type that is evaluated against a BrokeredMessage. + * @return the next definition stage. + */ + WithCreate withFilterType(FilterType filterType); + } + /** The stage of the Rule definition allowing to specify sqlFilter. */ + interface WithSqlFilter { + /** + * Specifies the sqlFilter property: Properties of sqlFilter. + * + * @param sqlFilter Properties of sqlFilter. + * @return the next definition stage. + */ + WithCreate withSqlFilter(SqlFilter sqlFilter); + } + /** The stage of the Rule definition allowing to specify correlationFilter. */ + interface WithCorrelationFilter { + /** + * Specifies the correlationFilter property: Properties of correlationFilter. + * + * @param correlationFilter Properties of correlationFilter. + * @return the next definition stage. + */ + WithCreate withCorrelationFilter(CorrelationFilter correlationFilter); + } + } + /** + * Begins update for the Rule resource. + * + * @return the stage of resource update. + */ + Rule.Update update(); + + /** The template for Rule update. */ + interface Update + extends UpdateStages.WithAction, + UpdateStages.WithFilterType, + UpdateStages.WithSqlFilter, + UpdateStages.WithCorrelationFilter { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Rule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Rule apply(Context context); + } + /** The Rule update stages. */ + interface UpdateStages { + /** The stage of the Rule update allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: Represents the filter actions which are allowed for the transformation of + * a message that have been matched by a filter expression.. + * + * @param action Represents the filter actions which are allowed for the transformation of a message that + * have been matched by a filter expression. + * @return the next definition stage. + */ + Update withAction(Action action); + } + /** The stage of the Rule update allowing to specify filterType. */ + interface WithFilterType { + /** + * Specifies the filterType property: Filter type that is evaluated against a BrokeredMessage.. + * + * @param filterType Filter type that is evaluated against a BrokeredMessage. + * @return the next definition stage. + */ + Update withFilterType(FilterType filterType); + } + /** The stage of the Rule update allowing to specify sqlFilter. */ + interface WithSqlFilter { + /** + * Specifies the sqlFilter property: Properties of sqlFilter. + * + * @param sqlFilter Properties of sqlFilter. + * @return the next definition stage. + */ + Update withSqlFilter(SqlFilter sqlFilter); + } + /** The stage of the Rule update allowing to specify correlationFilter. */ + interface WithCorrelationFilter { + /** + * Specifies the correlationFilter property: Properties of correlationFilter. + * + * @param correlationFilter Properties of correlationFilter. + * @return the next definition stage. + */ + Update withCorrelationFilter(CorrelationFilter correlationFilter); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Rule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Rule refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RuleListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RuleListResult.java new file mode 100644 index 000000000000..6b5d800f2622 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/RuleListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.RuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List rule operation. */ +@Fluent +public final class RuleListResult { + /* + * Result of the List Rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete list of rules + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RuleListResult class. */ + public RuleListResult() { + } + + /** + * Get the value property: Result of the List Rules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Rules operation. + * + * @param value the value value to set. + * @return the RuleListResult object itself. + */ + public RuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of rules. + * + * @param nextLink the nextLink value to set. + * @return the RuleListResult object itself. + */ + public RuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rules.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rules.java new file mode 100644 index 000000000000..e2357fe150a5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Rules.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Rules. */ +public interface Rules { + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscriptions( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * List all the rules within given topic-subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List rule operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscriptions( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + Integer skip, + Integer top, + Context context); + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * Deletes an existing rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + String ruleName, + Context context); + + /** + * Retrieves the description for the specified rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param ruleName The rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource. + */ + Rule get( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName); + + /** + * Retrieves the description for the specified rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + Rule getById(String id); + + /** + * Retrieves the description for the specified rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of Rule Resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an existing rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Rule resource. + * + * @param name resource name. + * @return the first stage of the new Rule definition. + */ + Rule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRule.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRule.java new file mode 100644 index 000000000000..3a0622b15f67 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRule.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import java.util.List; + +/** An immutable client-side representation of SBAuthorizationRule. */ +public interface SBAuthorizationRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner object. + * + * @return the inner object. + */ + SBAuthorizationRuleInner innerModel(); + + /** The entirety of the SBAuthorizationRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SBAuthorizationRule definition stages. */ + interface DefinitionStages { + /** The first stage of the SBAuthorizationRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SBAuthorizationRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + /** + * The stage of the SBAuthorizationRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithRights { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBAuthorizationRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBAuthorizationRule create(Context context); + } + /** The stage of the SBAuthorizationRule definition allowing to specify rights. */ + interface WithRights { + /** + * Specifies the rights property: The rights associated with the rule.. + * + * @param rights The rights associated with the rule. + * @return the next definition stage. + */ + WithCreate withRights(List rights); + } + } + /** + * Begins update for the SBAuthorizationRule resource. + * + * @return the stage of resource update. + */ + SBAuthorizationRule.Update update(); + + /** The template for SBAuthorizationRule update. */ + interface Update extends UpdateStages.WithRights { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBAuthorizationRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBAuthorizationRule apply(Context context); + } + /** The SBAuthorizationRule update stages. */ + interface UpdateStages { + /** The stage of the SBAuthorizationRule update allowing to specify rights. */ + interface WithRights { + /** + * Specifies the rights property: The rights associated with the rule.. + * + * @param rights The rights associated with the rule. + * @return the next definition stage. + */ + Update withRights(List rights); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBAuthorizationRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBAuthorizationRule refresh(Context context); + + /** + * Gets the primary and secondary connection strings for the namespace. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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(); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context); + + /** + * Regenerates the primary or secondary connection strings for the namespace. + * + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRuleListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRuleListResult.java new file mode 100644 index 000000000000..87027bcc4798 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBAuthorizationRuleListResult.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Namespace operation. */ +@Fluent +public final class SBAuthorizationRuleListResult { + /* + * Result of the List Authorization Rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete list of Authorization Rules. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SBAuthorizationRuleListResult class. */ + public SBAuthorizationRuleListResult() { + } + + /** + * Get the value property: Result of the List Authorization Rules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Authorization Rules operation. + * + * @param value the value value to set. + * @return the SBAuthorizationRuleListResult object itself. + */ + public SBAuthorizationRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Authorization Rules. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Authorization Rules. + * + * @param nextLink the nextLink value to set. + * @return the SBAuthorizationRuleListResult object itself. + */ + public SBAuthorizationRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBClientAffineProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBClientAffineProperties.java new file mode 100644 index 000000000000..746d493c5e71 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBClientAffineProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties specific to client affine subscriptions. */ +@Fluent +public final class SBClientAffineProperties { + /* + * Indicates the Client ID of the application that created the client-affine subscription. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * For client-affine subscriptions, this value indicates whether the subscription is durable or not. + */ + @JsonProperty(value = "isDurable") + private Boolean isDurable; + + /* + * For client-affine subscriptions, this value indicates whether the subscription is shared or not. + */ + @JsonProperty(value = "isShared") + private Boolean isShared; + + /** Creates an instance of SBClientAffineProperties class. */ + public SBClientAffineProperties() { + } + + /** + * Get the clientId property: Indicates the Client ID of the application that created the client-affine + * subscription. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Indicates the Client ID of the application that created the client-affine + * subscription. + * + * @param clientId the clientId value to set. + * @return the SBClientAffineProperties object itself. + */ + public SBClientAffineProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the isDurable property: For client-affine subscriptions, this value indicates whether the subscription is + * durable or not. + * + * @return the isDurable value. + */ + public Boolean isDurable() { + return this.isDurable; + } + + /** + * Set the isDurable property: For client-affine subscriptions, this value indicates whether the subscription is + * durable or not. + * + * @param isDurable the isDurable value to set. + * @return the SBClientAffineProperties object itself. + */ + public SBClientAffineProperties withIsDurable(Boolean isDurable) { + this.isDurable = isDurable; + return this; + } + + /** + * Get the isShared property: For client-affine subscriptions, this value indicates whether the subscription is + * shared or not. + * + * @return the isShared value. + */ + public Boolean isShared() { + return this.isShared; + } + + /** + * Set the isShared property: For client-affine subscriptions, this value indicates whether the subscription is + * shared or not. + * + * @param isShared the isShared value to set. + * @return the SBClientAffineProperties object itself. + */ + public SBClientAffineProperties withIsShared(Boolean isShared) { + this.isShared = isShared; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespace.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespace.java new file mode 100644 index 000000000000..a5f9e4be75df --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespace.java @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SBNamespace. */ +public interface SBNamespace { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: Properties of SKU. + * + * @return the sku value. + */ + SBSku sku(); + + /** + * Gets the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @return the minimumTlsVersion value. + */ + TlsVersion minimumTlsVersion(); + + /** + * Gets the provisioningState property: Provisioning state of the namespace. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: Status of the namespace. + * + * @return the status value. + */ + String status(); + + /** + * Gets the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * Gets the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + String metricId(); + + /** + * Gets the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in regions + * supported availability zones. + * + * @return the zoneRedundant value. + */ + Boolean zoneRedundant(); + + /** + * Gets the encryption property: Properties of BYOK Encryption description. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + Boolean disableLocalAuth(); + + /** + * Gets the alternateName property: Alternate name for namespace. + * + * @return the alternateName value. + */ + String alternateName(); + + /** + * Gets the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it + * is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the premiumMessagingPartitions property: The number of partitions of a Service Bus namespace. This property + * is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. + * + * @return the premiumMessagingPartitions value. + */ + Integer premiumMessagingPartitions(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner object. + * + * @return the inner object. + */ + SBNamespaceInner innerModel(); + + /** The entirety of the SBNamespace definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SBNamespace definition stages. */ + interface DefinitionStages { + /** The first stage of the SBNamespace definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SBNamespace definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SBNamespace definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SBNamespace definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithIdentity, + DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithZoneRedundant, + DefinitionStages.WithEncryption, + DefinitionStages.WithPrivateEndpointConnections, + DefinitionStages.WithDisableLocalAuth, + DefinitionStages.WithAlternateName, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithPremiumMessagingPartitions { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBNamespace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBNamespace create(Context context); + } + /** The stage of the SBNamespace definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SBNamespace definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of SKU. + * + * @param sku Properties of SKU. + * @return the next definition stage. + */ + WithCreate withSku(SBSku sku); + } + /** The stage of the SBNamespace definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Properties of BYOK Identity description. + * + * @param identity Properties of BYOK Identity description. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the SBNamespace definition allowing to specify minimumTlsVersion. */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @param minimumTlsVersion The minimum TLS version for the cluster to support, e.g. '1.2'. + * @return the next definition stage. + */ + WithCreate withMinimumTlsVersion(TlsVersion minimumTlsVersion); + } + /** The stage of the SBNamespace definition allowing to specify zoneRedundant. */ + interface WithZoneRedundant { + /** + * Specifies the zoneRedundant property: Enabling this property creates a Premium Service Bus Namespace in + * regions supported availability zones.. + * + * @param zoneRedundant Enabling this property creates a Premium Service Bus Namespace in regions supported + * availability zones. + * @return the next definition stage. + */ + WithCreate withZoneRedundant(Boolean zoneRedundant); + } + /** The stage of the SBNamespace definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Properties of BYOK Encryption description. + * + * @param encryption Properties of BYOK Encryption description. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + /** The stage of the SBNamespace definition allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the SBNamespace definition allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This property disables SAS authentication for the Service Bus + * namespace.. + * + * @param disableLocalAuth This property disables SAS authentication for the Service Bus namespace. + * @return the next definition stage. + */ + WithCreate withDisableLocalAuth(Boolean disableLocalAuth); + } + /** The stage of the SBNamespace definition allowing to specify alternateName. */ + interface WithAlternateName { + /** + * Specifies the alternateName property: Alternate name for namespace. + * + * @param alternateName Alternate name for namespace. + * @return the next definition stage. + */ + WithCreate withAlternateName(String alternateName); + } + /** The stage of the SBNamespace definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: This determines if traffic is allowed over public network. By + * default it is enabled.. + * + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is + * enabled. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the SBNamespace definition allowing to specify premiumMessagingPartitions. */ + interface WithPremiumMessagingPartitions { + /** + * Specifies the premiumMessagingPartitions property: The number of partitions of a Service Bus namespace. + * This property is only applicable to Premium SKU namespaces. The default value is 1 and possible values + * are 1, 2 and 4. + * + * @param premiumMessagingPartitions The number of partitions of a Service Bus namespace. This property is + * only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. + * @return the next definition stage. + */ + WithCreate withPremiumMessagingPartitions(Integer premiumMessagingPartitions); + } + } + /** + * Begins update for the SBNamespace resource. + * + * @return the stage of resource update. + */ + SBNamespace.Update update(); + + /** The template for SBNamespace update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithEncryption, + UpdateStages.WithPrivateEndpointConnections, + UpdateStages.WithDisableLocalAuth, + UpdateStages.WithAlternateName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBNamespace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBNamespace apply(Context context); + } + /** The SBNamespace update stages. */ + interface UpdateStages { + /** The stage of the SBNamespace update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SBNamespace update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Properties of SKU. + * + * @param sku Properties of SKU. + * @return the next definition stage. + */ + Update withSku(SBSku sku); + } + /** The stage of the SBNamespace update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Properties of BYOK Identity description. + * + * @param identity Properties of BYOK Identity description. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + /** The stage of the SBNamespace update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Properties of BYOK Encryption description. + * + * @param encryption Properties of BYOK Encryption description. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + /** The stage of the SBNamespace update allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + Update withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the SBNamespace update allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This property disables SAS authentication for the Service Bus + * namespace.. + * + * @param disableLocalAuth This property disables SAS authentication for the Service Bus namespace. + * @return the next definition stage. + */ + Update withDisableLocalAuth(Boolean disableLocalAuth); + } + /** The stage of the SBNamespace update allowing to specify alternateName. */ + interface WithAlternateName { + /** + * Specifies the alternateName property: Alternate name for namespace. + * + * @param alternateName Alternate name for namespace. + * @return the next definition stage. + */ + Update withAlternateName(String alternateName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBNamespace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBNamespace refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceListResult.java new file mode 100644 index 000000000000..b49f1bf28731 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceListResult.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List Namespace operation. */ +@Fluent +public final class SBNamespaceListResult { + /* + * 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; + + /** Creates an instance of SBNamespaceListResult class. */ + public SBNamespaceListResult() { + } + + /** + * Get the value property: Result of the List Namespace operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Namespace operation. + * + * @param value the value value to set. + * @return the SBNamespaceListResult object itself. + */ + public SBNamespaceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Namespaces. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * Namespaces. + * + * @param nextLink the nextLink value to set. + * @return the SBNamespaceListResult object itself. + */ + public SBNamespaceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceUpdateParameters.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceUpdateParameters.java new file mode 100644 index 000000000000..c7ee4c6d4d85 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBNamespaceUpdateParameters.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBNamespaceUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Description of a namespace resource. */ +@Fluent +public final class SBNamespaceUpdateParameters extends ResourceNamespacePatch { + /* + * Properties of SKU + */ + @JsonProperty(value = "sku") + private SBSku sku; + + /* + * Properties of the namespace. + */ + @JsonProperty(value = "properties") + private SBNamespaceUpdateProperties innerProperties; + + /* + * Properties of BYOK Identity description + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** Creates an instance of SBNamespaceUpdateParameters class. */ + public SBNamespaceUpdateParameters() { + } + + /** + * Get the sku property: Properties of SKU. + * + * @return the sku value. + */ + public SBSku sku() { + return this.sku; + } + + /** + * Set the sku property: Properties of SKU. + * + * @param sku the sku value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withSku(SBSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the innerProperties property: Properties of the namespace. + * + * @return the innerProperties value. + */ + private SBNamespaceUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: Properties of BYOK Identity description. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Properties of BYOK Identity description. + * + * @param identity the identity value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceUpdateParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SBNamespaceUpdateParameters 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 metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.innerProperties() == null ? null : this.innerProperties().metricId(); + } + + /** + * 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 SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withEncryption(Encryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceUpdateProperties(); + } + 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 SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withPrivateEndpointConnections( + List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceUpdateProperties(); + } + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.innerProperties() == null ? null : this.innerProperties().disableLocalAuth(); + } + + /** + * Set the disableLocalAuth property: This property disables SAS authentication for the Service Bus namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withDisableLocalAuth(Boolean disableLocalAuth) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceUpdateProperties(); + } + this.innerProperties().withDisableLocalAuth(disableLocalAuth); + return this; + } + + /** + * Get the alternateName property: Alternate name for namespace. + * + * @return the alternateName value. + */ + public String alternateName() { + return this.innerProperties() == null ? null : this.innerProperties().alternateName(); + } + + /** + * Set the alternateName property: Alternate name for namespace. + * + * @param alternateName the alternateName value to set. + * @return the SBNamespaceUpdateParameters object itself. + */ + public SBNamespaceUpdateParameters withAlternateName(String alternateName) { + if (this.innerProperties() == null) { + this.innerProperties = new SBNamespaceUpdateProperties(); + } + this.innerProperties().withAlternateName(alternateName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueue.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueue.java new file mode 100644 index 000000000000..558ce2054833 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueue.java @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SBQueue. */ +public interface SBQueue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the countDetails property: Message Count Details. + * + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * Gets the createdAt property: The exact time the message was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the accessedAt property: Last time a message was sent, or the last time there was a receive request to this + * queue. + * + * @return the accessedAt value. + */ + OffsetDateTime accessedAt(); + + /** + * Gets the sizeInBytes property: The size of the queue, in bytes. + * + * @return the sizeInBytes value. + */ + Long sizeInBytes(); + + /** + * Gets the messageCount property: The number of messages in the queue. + * + * @return the messageCount value. + */ + Long messageCount(); + + /** + * Gets the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 + * minute. + * + * @return the lockDuration value. + */ + Duration lockDuration(); + + /** + * Gets the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * + * @return the maxSizeInMegabytes value. + */ + Integer maxSizeInMegabytes(); + + /** + * Gets the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the queue. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + Long maxMessageSizeInKilobytes(); + + /** + * Gets the requiresDuplicateDetection property: A value indicating if this queue requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + Boolean requiresDuplicateDetection(); + + /** + * Gets the requiresSession property: A value that indicates whether the queue supports the concept of sessions. + * + * @return the requiresSession value. + */ + Boolean requiresSession(); + + /** + * Gets the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + Duration defaultMessageTimeToLive(); + + /** + * Gets the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + Boolean deadLetteringOnMessageExpiration(); + + /** + * Gets the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Duration duplicateDetectionHistoryTimeWindow(); + + /** + * Gets the maxDeliveryCount property: The maximum delivery count. A message is automatically deadlettered after + * this number of deliveries. default value is 10. + * + * @return the maxDeliveryCount value. + */ + Integer maxDeliveryCount(); + + /** + * Gets the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * Gets the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + Duration autoDeleteOnIdle(); + + /** + * Gets the enablePartitioning property: A value that indicates whether the queue is to be partitioned across + * multiple message brokers. + * + * @return the enablePartitioning value. + */ + Boolean enablePartitioning(); + + /** + * Gets the enableExpress property: A value that indicates whether Express Entities are enabled. An express queue + * holds a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value. + */ + Boolean enableExpress(); + + /** + * Gets the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + String forwardTo(); + + /** + * Gets the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + String forwardDeadLetteredMessagesTo(); + + /** + * Gets the 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner object. + * + * @return the inner object. + */ + SBQueueInner innerModel(); + + /** The entirety of the SBQueue definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SBQueue definition stages. */ + interface DefinitionStages { + /** The first stage of the SBQueue definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SBQueue definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + /** + * The stage of the SBQueue definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLockDuration, + DefinitionStages.WithMaxSizeInMegabytes, + DefinitionStages.WithMaxMessageSizeInKilobytes, + DefinitionStages.WithRequiresDuplicateDetection, + DefinitionStages.WithRequiresSession, + DefinitionStages.WithDefaultMessageTimeToLive, + DefinitionStages.WithDeadLetteringOnMessageExpiration, + DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, + DefinitionStages.WithMaxDeliveryCount, + DefinitionStages.WithStatus, + DefinitionStages.WithEnableBatchedOperations, + DefinitionStages.WithAutoDeleteOnIdle, + DefinitionStages.WithEnablePartitioning, + DefinitionStages.WithEnableExpress, + DefinitionStages.WithForwardTo, + DefinitionStages.WithForwardDeadLetteredMessagesTo { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBQueue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBQueue create(Context context); + } + /** The stage of the SBQueue definition allowing to specify lockDuration. */ + interface WithLockDuration { + /** + * Specifies the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of + * time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the + * default value is 1 minute.. + * + * @param lockDuration ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default + * value is 1 minute. + * @return the next definition stage. + */ + WithCreate withLockDuration(Duration lockDuration); + } + /** The stage of the SBQueue definition allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size + * of memory allocated for the queue. Default is 1024.. + * + * @param maxSizeInMegabytes The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * @return the next definition stage. + */ + WithCreate withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + /** The stage of the SBQueue definition allowing to specify maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the queue. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * queue. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + WithCreate withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBQueue definition allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: A value indicating if this queue requires duplicate + * detection.. + * + * @param requiresDuplicateDetection A value indicating if this queue requires duplicate detection. + * @return the next definition stage. + */ + WithCreate withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + /** The stage of the SBQueue definition allowing to specify requiresSession. */ + interface WithRequiresSession { + /** + * Specifies the requiresSession property: A value that indicates whether the queue supports the concept of + * sessions.. + * + * @param requiresSession A value that indicates whether the queue supports the concept of sessions. + * @return the next definition stage. + */ + WithCreate withRequiresSession(Boolean requiresSession); + } + /** The stage of the SBQueue definition allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is + * the duration after which the message expires, starting from when the message is sent to Service Bus. This + * is the default value used when TimeToLive is not set on a message itself.. + * + * @param defaultMessageTimeToLive ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the + * default value used when TimeToLive is not set on a message itself. + * @return the next definition stage. + */ + WithCreate withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive); + } + /** The stage of the SBQueue definition allowing to specify deadLetteringOnMessageExpiration. */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has + * dead letter support when a message expires.. + * + * @param deadLetteringOnMessageExpiration A value that indicates whether this queue has dead letter support + * when a message expires. + * @return the next definition stage. + */ + WithCreate withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + /** The stage of the SBQueue definition allowing to specify duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * @return the next definition stage. + */ + WithCreate withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBQueue definition allowing to specify maxDeliveryCount. */ + interface WithMaxDeliveryCount { + /** + * Specifies the maxDeliveryCount property: The maximum delivery count. A message is automatically + * deadlettered after this number of deliveries. default value is 10.. + * + * @param maxDeliveryCount The maximum delivery count. A message is automatically deadlettered after this + * number of deliveries. default value is 10. + * @return the next definition stage. + */ + WithCreate withMaxDeliveryCount(Integer maxDeliveryCount); + } + /** The stage of the SBQueue definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + WithCreate withStatus(EntityStatus status); + } + /** The stage of the SBQueue definition allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled. + * @return the next definition stage. + */ + WithCreate withEnableBatchedOperations(Boolean enableBatchedOperations); + } + /** The stage of the SBQueue definition allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @param autoDeleteOnIdle ISO 8061 timeSpan idle interval after which the queue is automatically deleted. + * The minimum duration is 5 minutes. + * @return the next definition stage. + */ + WithCreate withAutoDeleteOnIdle(Duration autoDeleteOnIdle); + } + /** The stage of the SBQueue definition allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: A value that indicates whether the queue is to be partitioned + * across multiple message brokers.. + * + * @param enablePartitioning A value that indicates whether the queue is to be partitioned across multiple + * message brokers. + * @return the next definition stage. + */ + WithCreate withEnablePartitioning(Boolean enablePartitioning); + } + /** The stage of the SBQueue definition allowing to specify enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: A value that indicates whether Express Entities are enabled. An + * express queue holds a message in memory temporarily before writing it to persistent storage.. + * + * @param enableExpress A value that indicates whether Express Entities are enabled. An express queue holds + * a message in memory temporarily before writing it to persistent storage. + * @return the next definition stage. + */ + WithCreate withEnableExpress(Boolean enableExpress); + } + /** The stage of the SBQueue definition allowing to specify forwardTo. */ + interface WithForwardTo { + /** + * Specifies the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo Queue/Topic name to forward the messages. + * @return the next definition stage. + */ + WithCreate withForwardTo(String forwardTo); + } + /** The stage of the SBQueue definition allowing to specify forwardDeadLetteredMessagesTo. */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter + * message. + * + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message. + * @return the next definition stage. + */ + WithCreate withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + } + /** + * Begins update for the SBQueue resource. + * + * @return the stage of resource update. + */ + SBQueue.Update update(); + + /** The template for SBQueue update. */ + interface Update + extends UpdateStages.WithLockDuration, + UpdateStages.WithMaxSizeInMegabytes, + UpdateStages.WithMaxMessageSizeInKilobytes, + UpdateStages.WithRequiresDuplicateDetection, + UpdateStages.WithRequiresSession, + UpdateStages.WithDefaultMessageTimeToLive, + UpdateStages.WithDeadLetteringOnMessageExpiration, + UpdateStages.WithDuplicateDetectionHistoryTimeWindow, + UpdateStages.WithMaxDeliveryCount, + UpdateStages.WithStatus, + UpdateStages.WithEnableBatchedOperations, + UpdateStages.WithAutoDeleteOnIdle, + UpdateStages.WithEnablePartitioning, + UpdateStages.WithEnableExpress, + UpdateStages.WithForwardTo, + UpdateStages.WithForwardDeadLetteredMessagesTo { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBQueue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBQueue apply(Context context); + } + /** The SBQueue update stages. */ + interface UpdateStages { + /** The stage of the SBQueue update allowing to specify lockDuration. */ + interface WithLockDuration { + /** + * Specifies the lockDuration property: ISO 8601 timespan duration of a peek-lock; that is, the amount of + * time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the + * default value is 1 minute.. + * + * @param lockDuration ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the + * message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default + * value is 1 minute. + * @return the next definition stage. + */ + Update withLockDuration(Duration lockDuration); + } + /** The stage of the SBQueue update allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: The maximum size of the queue in megabytes, which is the size + * of memory allocated for the queue. Default is 1024.. + * + * @param maxSizeInMegabytes The maximum size of the queue in megabytes, which is the size of memory + * allocated for the queue. Default is 1024. + * @return the next definition stage. + */ + Update withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + /** The stage of the SBQueue update allowing to specify maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the queue. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * queue. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + Update withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBQueue update allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: A value indicating if this queue requires duplicate + * detection.. + * + * @param requiresDuplicateDetection A value indicating if this queue requires duplicate detection. + * @return the next definition stage. + */ + Update withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + /** The stage of the SBQueue update allowing to specify requiresSession. */ + interface WithRequiresSession { + /** + * Specifies the requiresSession property: A value that indicates whether the queue supports the concept of + * sessions.. + * + * @param requiresSession A value that indicates whether the queue supports the concept of sessions. + * @return the next definition stage. + */ + Update withRequiresSession(Boolean requiresSession); + } + /** The stage of the SBQueue update allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: ISO 8601 default message timespan to live value. This is + * the duration after which the message expires, starting from when the message is sent to Service Bus. This + * is the default value used when TimeToLive is not set on a message itself.. + * + * @param defaultMessageTimeToLive ISO 8601 default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the + * default value used when TimeToLive is not set on a message itself. + * @return the next definition stage. + */ + Update withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive); + } + /** The stage of the SBQueue update allowing to specify deadLetteringOnMessageExpiration. */ + interface WithDeadLetteringOnMessageExpiration { + /** + * Specifies the deadLetteringOnMessageExpiration property: A value that indicates whether this queue has + * dead letter support when a message expires.. + * + * @param deadLetteringOnMessageExpiration A value that indicates whether this queue has dead letter support + * when a message expires. + * @return the next definition stage. + */ + Update withDeadLetteringOnMessageExpiration(Boolean deadLetteringOnMessageExpiration); + } + /** The stage of the SBQueue update allowing to specify duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * @return the next definition stage. + */ + Update withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBQueue update allowing to specify maxDeliveryCount. */ + interface WithMaxDeliveryCount { + /** + * Specifies the maxDeliveryCount property: The maximum delivery count. A message is automatically + * deadlettered after this number of deliveries. default value is 10.. + * + * @param maxDeliveryCount The maximum delivery count. A message is automatically deadlettered after this + * number of deliveries. default value is 10. + * @return the next definition stage. + */ + Update withMaxDeliveryCount(Integer maxDeliveryCount); + } + /** The stage of the SBQueue update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + Update withStatus(EntityStatus status); + } + /** The stage of the SBQueue update allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled. + * @return the next definition stage. + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + /** The stage of the SBQueue update allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the queue is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @param autoDeleteOnIdle ISO 8061 timeSpan idle interval after which the queue is automatically deleted. + * The minimum duration is 5 minutes. + * @return the next definition stage. + */ + Update withAutoDeleteOnIdle(Duration autoDeleteOnIdle); + } + /** The stage of the SBQueue update allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: A value that indicates whether the queue is to be partitioned + * across multiple message brokers.. + * + * @param enablePartitioning A value that indicates whether the queue is to be partitioned across multiple + * message brokers. + * @return the next definition stage. + */ + Update withEnablePartitioning(Boolean enablePartitioning); + } + /** The stage of the SBQueue update allowing to specify enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: A value that indicates whether Express Entities are enabled. An + * express queue holds a message in memory temporarily before writing it to persistent storage.. + * + * @param enableExpress A value that indicates whether Express Entities are enabled. An express queue holds + * a message in memory temporarily before writing it to persistent storage. + * @return the next definition stage. + */ + Update withEnableExpress(Boolean enableExpress); + } + /** The stage of the SBQueue update allowing to specify forwardTo. */ + interface WithForwardTo { + /** + * Specifies the forwardTo property: Queue/Topic name to forward the messages. + * + * @param forwardTo Queue/Topic name to forward the messages. + * @return the next definition stage. + */ + Update withForwardTo(String forwardTo); + } + /** The stage of the SBQueue update allowing to specify forwardDeadLetteredMessagesTo. */ + interface WithForwardDeadLetteredMessagesTo { + /** + * Specifies the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter + * message. + * + * @param forwardDeadLetteredMessagesTo Queue/Topic name to forward the Dead Letter message. + * @return the next definition stage. + */ + Update withForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBQueue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBQueue refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueueListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueueListResult.java new file mode 100644 index 000000000000..0a00621987f1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBQueueListResult.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBQueueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Queues operation. */ +@Fluent +public final class SBQueueListResult { + /* + * Result of the List Queues operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete list of queues. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SBQueueListResult class. */ + public SBQueueListResult() { + } + + /** + * Get the value property: Result of the List Queues operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Queues operation. + * + * @param value the value value to set. + * @return the SBQueueListResult object itself. + */ + public SBQueueListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * queues. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * queues. + * + * @param nextLink the nextLink value to set. + * @return the SBQueueListResult object itself. + */ + public SBQueueListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSku.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSku.java new file mode 100644 index 000000000000..bd91912ff5ed --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSku.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of the namespace. */ +@Fluent +public final class SBSku { + /* + * 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; + + /* + * Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of your + * properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then + * possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions is 4 then possible + * capacity values are 4, 8, 16, 32 and 64 + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** Creates an instance of SBSku class. */ + public SBSku() { + } + + /** + * Get the name property: Name of this SKU. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Name of this SKU. + * + * @param name the name value to set. + * @return the SBSku object itself. + */ + public SBSku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The billing tier of this particular SKU. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The billing tier of this particular SKU. + * + * @param tier the tier value to set. + * @return the SBSku object itself. + */ + public SBSku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, + * 8, 16} multiples of your properties.premiumMessagingPartitions setting. For example, If + * properties.premiumMessagingPartitions is 1 then possible capacity values are 1, 2, 4, 8, and 16. If + * properties.premiumMessagingPartitions is 4 then possible capacity values are 4, 8, 16, 32 and 64. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, + * 8, 16} multiples of your properties.premiumMessagingPartitions setting. For example, If + * properties.premiumMessagingPartitions is 1 then possible capacity values are 1, 2, 4, 8, and 16. If + * properties.premiumMessagingPartitions is 4 then possible capacity values are 4, 8, 16, 32 and 64. + * + * @param capacity the capacity value to set. + * @return the SBSku object itself. + */ + public SBSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model SBSku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SBSku.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscription.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscription.java new file mode 100644 index 000000000000..0c5d0bf7deb2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscription.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.servicebus.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SBSubscription. */ +public interface SBSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the messageCount property: Number of messages. + * + * @return the messageCount value. + */ + Long messageCount(); + + /** + * Gets the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the accessedAt property: Last time there was a receive request to this subscription. + * + * @return the accessedAt value. + */ + OffsetDateTime accessedAt(); + + /** + * Gets the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the countDetails property: Message count details. + * + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * Gets the lockDuration property: ISO 8061 lock duration timespan for the subscription. The default value is 1 + * minute. + * + * @return the lockDuration value. + */ + Duration lockDuration(); + + /** + * Gets the requiresSession property: Value indicating if a subscription supports the concept of sessions. + * + * @return the requiresSession value. + */ + Boolean requiresSession(); + + /** + * Gets the defaultMessageTimeToLive property: ISO 8061 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + Duration defaultMessageTimeToLive(); + + /** + * Gets the deadLetteringOnFilterEvaluationExceptions property: Value that indicates whether a subscription has dead + * letter support on filter evaluation exceptions. + * + * @return the deadLetteringOnFilterEvaluationExceptions value. + */ + Boolean deadLetteringOnFilterEvaluationExceptions(); + + /** + * Gets the deadLetteringOnMessageExpiration property: Value that indicates whether a subscription has dead letter + * support when a message expires. + * + * @return the deadLetteringOnMessageExpiration value. + */ + Boolean deadLetteringOnMessageExpiration(); + + /** + * Gets the duplicateDetectionHistoryTimeWindow property: ISO 8601 timeSpan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Duration duplicateDetectionHistoryTimeWindow(); + + /** + * Gets the maxDeliveryCount property: Number of maximum deliveries. + * + * @return the maxDeliveryCount value. + */ + Integer maxDeliveryCount(); + + /** + * Gets the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * Gets the autoDeleteOnIdle property: ISO 8061 timeSpan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + Duration autoDeleteOnIdle(); + + /** + * Gets the forwardTo property: Queue/Topic name to forward the messages. + * + * @return the forwardTo value. + */ + String forwardTo(); + + /** + * Gets the forwardDeadLetteredMessagesTo property: Queue/Topic name to forward the Dead Letter message. + * + * @return the forwardDeadLetteredMessagesTo value. + */ + String forwardDeadLetteredMessagesTo(); + + /** + * Gets the isClientAffine property: Value that indicates whether the subscription has an affinity to the client id. + * + * @return the isClientAffine value. + */ + Boolean isClientAffine(); + + /** + * Gets the clientAffineProperties property: Properties specific to client affine subscriptions. + * + * @return the clientAffineProperties value. + */ + SBClientAffineProperties clientAffineProperties(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner object. + * + * @return the inner object. + */ + SBSubscriptionInner innerModel(); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscriptionListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscriptionListResult.java new file mode 100644 index 000000000000..97f946d8e2fc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBSubscriptionListResult.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Subscriptions operation. */ +@Fluent +public final class SBSubscriptionListResult { + /* + * Result of the List Subscriptions operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete list of subscriptions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SBSubscriptionListResult class. */ + public SBSubscriptionListResult() { + } + + /** + * Get the value property: Result of the List Subscriptions operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Subscriptions operation. + * + * @param value the value value to set. + * @return the SBSubscriptionListResult object itself. + */ + public SBSubscriptionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * subscriptions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * subscriptions. + * + * @param nextLink the nextLink value to set. + * @return the SBSubscriptionListResult object itself. + */ + public SBSubscriptionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopic.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopic.java new file mode 100644 index 000000000000..b8f4b221a07d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopic.java @@ -0,0 +1,567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SBTopic. */ +public interface SBTopic { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the sizeInBytes property: Size of the topic, in bytes. + * + * @return the sizeInBytes value. + */ + Long sizeInBytes(); + + /** + * Gets the createdAt property: Exact time the message was created. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: The exact time the message was updated. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the accessedAt property: Last time the message was sent, or a request was received, for this topic. + * + * @return the accessedAt value. + */ + OffsetDateTime accessedAt(); + + /** + * Gets the subscriptionCount property: Number of subscriptions. + * + * @return the subscriptionCount value. + */ + Integer subscriptionCount(); + + /** + * Gets the countDetails property: Message count details. + * + * @return the countDetails value. + */ + MessageCountDetails countDetails(); + + /** + * Gets the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the default value + * used when TimeToLive is not set on a message itself. + * + * @return the defaultMessageTimeToLive value. + */ + Duration defaultMessageTimeToLive(); + + /** + * Gets the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * + * @return the maxSizeInMegabytes value. + */ + Integer maxSizeInMegabytes(); + + /** + * Gets the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be accepted by + * the topic. This property is only used in Premium today and default is 1024. + * + * @return the maxMessageSizeInKilobytes value. + */ + Long maxMessageSizeInKilobytes(); + + /** + * Gets the requiresDuplicateDetection property: Value indicating if this topic requires duplicate detection. + * + * @return the requiresDuplicateDetection value. + */ + Boolean requiresDuplicateDetection(); + + /** + * Gets the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the duration of + * the duplicate detection history. The default value is 10 minutes. + * + * @return the duplicateDetectionHistoryTimeWindow value. + */ + Duration duplicateDetectionHistoryTimeWindow(); + + /** + * Gets the enableBatchedOperations property: Value that indicates whether server-side batched operations are + * enabled. + * + * @return the enableBatchedOperations value. + */ + Boolean enableBatchedOperations(); + + /** + * Gets the status property: Enumerates the possible values for the status of a messaging entity. + * + * @return the status value. + */ + EntityStatus status(); + + /** + * Gets the supportOrdering property: Value that indicates whether the topic supports ordering. + * + * @return the supportOrdering value. + */ + Boolean supportOrdering(); + + /** + * Gets the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is automatically + * deleted. The minimum duration is 5 minutes. + * + * @return the autoDeleteOnIdle value. + */ + Duration autoDeleteOnIdle(); + + /** + * Gets the enablePartitioning property: Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * + * @return the enablePartitioning value. + */ + Boolean enablePartitioning(); + + /** + * Gets the enableExpress property: Value that indicates whether Express Entities are enabled. An express topic + * holds a message in memory temporarily before writing it to persistent storage. + * + * @return the enableExpress value. + */ + Boolean enableExpress(); + + /** + * Gets the 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner object. + * + * @return the inner object. + */ + SBTopicInner innerModel(); + + /** The entirety of the SBTopic definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SBTopic definition stages. */ + interface DefinitionStages { + /** The first stage of the SBTopic definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SBTopic definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + /** + * The stage of the SBTopic definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDefaultMessageTimeToLive, + DefinitionStages.WithMaxSizeInMegabytes, + DefinitionStages.WithMaxMessageSizeInKilobytes, + DefinitionStages.WithRequiresDuplicateDetection, + DefinitionStages.WithDuplicateDetectionHistoryTimeWindow, + DefinitionStages.WithEnableBatchedOperations, + DefinitionStages.WithStatus, + DefinitionStages.WithSupportOrdering, + DefinitionStages.WithAutoDeleteOnIdle, + DefinitionStages.WithEnablePartitioning, + DefinitionStages.WithEnableExpress { + /** + * Executes the create request. + * + * @return the created resource. + */ + SBTopic create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SBTopic create(Context context); + } + /** The stage of the SBTopic definition allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is + * the duration after which the message expires, starting from when the message is sent to Service Bus. This + * is the default value used when TimeToLive is not set on a message itself.. + * + * @param defaultMessageTimeToLive ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the + * default value used when TimeToLive is not set on a message itself. + * @return the next definition stage. + */ + WithCreate withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive); + } + /** The stage of the SBTopic definition allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of + * the memory allocated for the topic. Default is 1024.. + * + * @param maxSizeInMegabytes Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * @return the next definition stage. + */ + WithCreate withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + /** The stage of the SBTopic definition allowing to specify maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the topic. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * topic. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + WithCreate withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBTopic definition allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: Value indicating if this topic requires duplicate + * detection.. + * + * @param requiresDuplicateDetection Value indicating if this topic requires duplicate detection. + * @return the next definition stage. + */ + WithCreate withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + /** The stage of the SBTopic definition allowing to specify duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @param duplicateDetectionHistoryTimeWindow ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * @return the next definition stage. + */ + WithCreate withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBTopic definition allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled. + * @return the next definition stage. + */ + WithCreate withEnableBatchedOperations(Boolean enableBatchedOperations); + } + /** The stage of the SBTopic definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + WithCreate withStatus(EntityStatus status); + } + /** The stage of the SBTopic definition allowing to specify supportOrdering. */ + interface WithSupportOrdering { + /** + * Specifies the supportOrdering property: Value that indicates whether the topic supports ordering.. + * + * @param supportOrdering Value that indicates whether the topic supports ordering. + * @return the next definition stage. + */ + WithCreate withSupportOrdering(Boolean supportOrdering); + } + /** The stage of the SBTopic definition allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @param autoDeleteOnIdle ISO 8601 timespan idle interval after which the topic is automatically deleted. + * The minimum duration is 5 minutes. + * @return the next definition stage. + */ + WithCreate withAutoDeleteOnIdle(Duration autoDeleteOnIdle); + } + /** The stage of the SBTopic definition allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: Value that indicates whether the topic to be partitioned + * across multiple message brokers is enabled.. + * + * @param enablePartitioning Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * @return the next definition stage. + */ + WithCreate withEnablePartitioning(Boolean enablePartitioning); + } + /** The stage of the SBTopic definition allowing to specify enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: Value that indicates whether Express Entities are enabled. An + * express topic holds a message in memory temporarily before writing it to persistent storage.. + * + * @param enableExpress Value that indicates whether Express Entities are enabled. An express topic holds a + * message in memory temporarily before writing it to persistent storage. + * @return the next definition stage. + */ + WithCreate withEnableExpress(Boolean enableExpress); + } + } + /** + * Begins update for the SBTopic resource. + * + * @return the stage of resource update. + */ + SBTopic.Update update(); + + /** The template for SBTopic update. */ + interface Update + extends UpdateStages.WithDefaultMessageTimeToLive, + UpdateStages.WithMaxSizeInMegabytes, + UpdateStages.WithMaxMessageSizeInKilobytes, + UpdateStages.WithRequiresDuplicateDetection, + UpdateStages.WithDuplicateDetectionHistoryTimeWindow, + UpdateStages.WithEnableBatchedOperations, + UpdateStages.WithStatus, + UpdateStages.WithSupportOrdering, + UpdateStages.WithAutoDeleteOnIdle, + UpdateStages.WithEnablePartitioning, + UpdateStages.WithEnableExpress { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SBTopic apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SBTopic apply(Context context); + } + /** The SBTopic update stages. */ + interface UpdateStages { + /** The stage of the SBTopic update allowing to specify defaultMessageTimeToLive. */ + interface WithDefaultMessageTimeToLive { + /** + * Specifies the defaultMessageTimeToLive property: ISO 8601 Default message timespan to live value. This is + * the duration after which the message expires, starting from when the message is sent to Service Bus. This + * is the default value used when TimeToLive is not set on a message itself.. + * + * @param defaultMessageTimeToLive ISO 8601 Default message timespan to live value. This is the duration + * after which the message expires, starting from when the message is sent to Service Bus. This is the + * default value used when TimeToLive is not set on a message itself. + * @return the next definition stage. + */ + Update withDefaultMessageTimeToLive(Duration defaultMessageTimeToLive); + } + /** The stage of the SBTopic update allowing to specify maxSizeInMegabytes. */ + interface WithMaxSizeInMegabytes { + /** + * Specifies the maxSizeInMegabytes property: Maximum size of the topic in megabytes, which is the size of + * the memory allocated for the topic. Default is 1024.. + * + * @param maxSizeInMegabytes Maximum size of the topic in megabytes, which is the size of the memory + * allocated for the topic. Default is 1024. + * @return the next definition stage. + */ + Update withMaxSizeInMegabytes(Integer maxSizeInMegabytes); + } + /** The stage of the SBTopic update allowing to specify maxMessageSizeInKilobytes. */ + interface WithMaxMessageSizeInKilobytes { + /** + * Specifies the maxMessageSizeInKilobytes property: Maximum size (in KB) of the message payload that can be + * accepted by the topic. This property is only used in Premium today and default is 1024.. + * + * @param maxMessageSizeInKilobytes Maximum size (in KB) of the message payload that can be accepted by the + * topic. This property is only used in Premium today and default is 1024. + * @return the next definition stage. + */ + Update withMaxMessageSizeInKilobytes(Long maxMessageSizeInKilobytes); + } + /** The stage of the SBTopic update allowing to specify requiresDuplicateDetection. */ + interface WithRequiresDuplicateDetection { + /** + * Specifies the requiresDuplicateDetection property: Value indicating if this topic requires duplicate + * detection.. + * + * @param requiresDuplicateDetection Value indicating if this topic requires duplicate detection. + * @return the next definition stage. + */ + Update withRequiresDuplicateDetection(Boolean requiresDuplicateDetection); + } + /** The stage of the SBTopic update allowing to specify duplicateDetectionHistoryTimeWindow. */ + interface WithDuplicateDetectionHistoryTimeWindow { + /** + * Specifies the duplicateDetectionHistoryTimeWindow property: ISO8601 timespan structure that defines the + * duration of the duplicate detection history. The default value is 10 minutes.. + * + * @param duplicateDetectionHistoryTimeWindow ISO8601 timespan structure that defines the duration of the + * duplicate detection history. The default value is 10 minutes. + * @return the next definition stage. + */ + Update withDuplicateDetectionHistoryTimeWindow(Duration duplicateDetectionHistoryTimeWindow); + } + /** The stage of the SBTopic update allowing to specify enableBatchedOperations. */ + interface WithEnableBatchedOperations { + /** + * Specifies the enableBatchedOperations property: Value that indicates whether server-side batched + * operations are enabled.. + * + * @param enableBatchedOperations Value that indicates whether server-side batched operations are enabled. + * @return the next definition stage. + */ + Update withEnableBatchedOperations(Boolean enableBatchedOperations); + } + /** The stage of the SBTopic update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Enumerates the possible values for the status of a messaging entity.. + * + * @param status Enumerates the possible values for the status of a messaging entity. + * @return the next definition stage. + */ + Update withStatus(EntityStatus status); + } + /** The stage of the SBTopic update allowing to specify supportOrdering. */ + interface WithSupportOrdering { + /** + * Specifies the supportOrdering property: Value that indicates whether the topic supports ordering.. + * + * @param supportOrdering Value that indicates whether the topic supports ordering. + * @return the next definition stage. + */ + Update withSupportOrdering(Boolean supportOrdering); + } + /** The stage of the SBTopic update allowing to specify autoDeleteOnIdle. */ + interface WithAutoDeleteOnIdle { + /** + * Specifies the autoDeleteOnIdle property: ISO 8601 timespan idle interval after which the topic is + * automatically deleted. The minimum duration is 5 minutes.. + * + * @param autoDeleteOnIdle ISO 8601 timespan idle interval after which the topic is automatically deleted. + * The minimum duration is 5 minutes. + * @return the next definition stage. + */ + Update withAutoDeleteOnIdle(Duration autoDeleteOnIdle); + } + /** The stage of the SBTopic update allowing to specify enablePartitioning. */ + interface WithEnablePartitioning { + /** + * Specifies the enablePartitioning property: Value that indicates whether the topic to be partitioned + * across multiple message brokers is enabled.. + * + * @param enablePartitioning Value that indicates whether the topic to be partitioned across multiple + * message brokers is enabled. + * @return the next definition stage. + */ + Update withEnablePartitioning(Boolean enablePartitioning); + } + /** The stage of the SBTopic update allowing to specify enableExpress. */ + interface WithEnableExpress { + /** + * Specifies the enableExpress property: Value that indicates whether Express Entities are enabled. An + * express topic holds a message in memory temporarily before writing it to persistent storage.. + * + * @param enableExpress Value that indicates whether Express Entities are enabled. An express topic holds a + * message in memory temporarily before writing it to persistent storage. + * @return the next definition stage. + */ + Update withEnableExpress(Boolean enableExpress); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SBTopic refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SBTopic refresh(Context context); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopicListResult.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopicListResult.java new file mode 100644 index 000000000000..3cfed574e4d1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SBTopicListResult.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBTopicInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to the List Topics operation. */ +@Fluent +public final class SBTopicListResult { + /* + * Result of the List Topics operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete list of topics. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SBTopicListResult class. */ + public SBTopicListResult() { + } + + /** + * Get the value property: Result of the List Topics operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List Topics operation. + * + * @param value the value value to set. + * @return the SBTopicListResult object itself. + */ + public SBTopicListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * topics. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of + * topics. + * + * @param nextLink the nextLink value to set. + * @return the SBTopicListResult object itself. + */ + public SBTopicListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuName.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuName.java new file mode 100644 index 000000000000..077f4bb84009 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuName.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Name of this SKU. */ +public enum SkuName { + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuName instance. */ + private final String value; + + SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + if (value == null) { + return null; + } + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuTier.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuTier.java new file mode 100644 index 000000000000..242643924c06 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SkuTier.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The billing tier of this particular SKU. */ +public enum SkuTier { + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + if (value == null) { + return null; + } + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlFilter.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlFilter.java new file mode 100644 index 000000000000..fbf6cf429769 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlFilter.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. + */ +@Fluent +public final class SqlFilter { + /* + * The SQL expression. e.g. MyProperty='ABC' + */ + @JsonProperty(value = "sqlExpression") + private String sqlExpression; + + /* + * This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded + * to 20. + */ + @JsonProperty(value = "compatibilityLevel") + private Integer compatibilityLevel; + + /* + * Value that indicates whether the rule action requires preprocessing. + */ + @JsonProperty(value = "requiresPreprocessing") + private Boolean requiresPreprocessing; + + /** Creates an instance of SqlFilter class. */ + public SqlFilter() { + } + + /** + * Get the sqlExpression property: The SQL expression. e.g. MyProperty='ABC'. + * + * @return the sqlExpression value. + */ + public String sqlExpression() { + return this.sqlExpression; + } + + /** + * Set the sqlExpression property: The SQL expression. e.g. MyProperty='ABC'. + * + * @param sqlExpression the sqlExpression value to set. + * @return the SqlFilter object itself. + */ + public SqlFilter withSqlExpression(String sqlExpression) { + this.sqlExpression = sqlExpression; + return this; + } + + /** + * Get the compatibilityLevel property: This property is reserved for future use. An integer value showing the + * compatibility level, currently hard-coded to 20. + * + * @return the compatibilityLevel value. + */ + public Integer compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set the compatibilityLevel property: This property is reserved for future use. An integer value showing the + * compatibility level, currently hard-coded to 20. + * + * @param compatibilityLevel the compatibilityLevel value to set. + * @return the SqlFilter object itself. + */ + public SqlFilter withCompatibilityLevel(Integer compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @return the requiresPreprocessing value. + */ + public Boolean requiresPreprocessing() { + return this.requiresPreprocessing; + } + + /** + * Set the requiresPreprocessing property: Value that indicates whether the rule action requires preprocessing. + * + * @param requiresPreprocessing the requiresPreprocessing value to set. + * @return the SqlFilter object itself. + */ + public SqlFilter withRequiresPreprocessing(Boolean requiresPreprocessing) { + this.requiresPreprocessing = requiresPreprocessing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlRuleAction.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlRuleAction.java new file mode 100644 index 000000000000..de59bd49a1a4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/SqlRuleAction.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; + +/** + * Represents set of actions written in SQL language-based syntax that is performed against a + * ServiceBus.Messaging.BrokeredMessage. + */ +@Fluent +public final class SqlRuleAction extends Action { + /** Creates an instance of SqlRuleAction class. */ + public SqlRuleAction() { + } + + /** {@inheritDoc} */ + @Override + public SqlRuleAction withSqlExpression(String sqlExpression) { + super.withSqlExpression(sqlExpression); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlRuleAction withCompatibilityLevel(Integer compatibilityLevel) { + super.withCompatibilityLevel(compatibilityLevel); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlRuleAction withRequiresPreprocessing(Boolean requiresPreprocessing) { + super.withRequiresPreprocessing(requiresPreprocessing); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subnet.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subnet.java new file mode 100644 index 000000000000..a43b75947783 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subnet.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.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties supplied for Subnet. */ +@Fluent +public final class Subnet { + /* + * Resource ID of Virtual Network Subnet + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** Creates an instance of Subnet class. */ + public Subnet() { + } + + /** + * Get the id property: Resource ID of Virtual Network Subnet. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of Virtual Network Subnet. + * + * @param id the id value to set. + * @return the Subnet object itself. + */ + public Subnet withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property id in model Subnet")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Subnet.class); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subscriptions.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subscriptions.java new file mode 100644 index 000000000000..9ab676e570fa --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Subscriptions.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; + +/** Resource collection API of Subscriptions. */ +public interface Subscriptions { + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTopic(String resourceGroupName, String namespaceName, String topicName); + + /** + * List all the subscriptions under a specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to the List Subscriptions operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTopic( + String resourceGroupName, String namespaceName, String topicName, Integer skip, Integer top, Context context); + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response}. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters, + Context context); + + /** + * Creates a topic subscription. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param parameters Parameters supplied to create a subscription resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + SBSubscription createOrUpdate( + String resourceGroupName, + String namespaceName, + String topicName, + String subscriptionName, + SBSubscriptionInner parameters); + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); + + /** + * Deletes a subscription from the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, String subscriptionName, Context context); + + /** + * Returns a subscription description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param subscriptionName The subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of subscription resource. + */ + SBSubscription get(String resourceGroupName, String namespaceName, String topicName, String subscriptionName); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/TlsVersion.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/TlsVersion.java new file mode 100644 index 000000000000..1920482e0a29 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/TlsVersion.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.servicebus.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The minimum TLS version for the cluster to support, e.g. '1.2'. */ +public final class TlsVersion extends ExpandableStringEnum { + /** Static value 1.0 for TlsVersion. */ + public static final TlsVersion ONE_ZERO = fromString("1.0"); + + /** Static value 1.1 for TlsVersion. */ + public static final TlsVersion ONE_ONE = fromString("1.1"); + + /** Static value 1.2 for TlsVersion. */ + public static final TlsVersion ONE_TWO = fromString("1.2"); + + /** + * Creates or finds a TlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding TlsVersion. + */ + @JsonCreator + public static TlsVersion fromString(String name) { + return fromString(name, TlsVersion.class); + } + + /** + * Gets known TlsVersion values. + * + * @return known TlsVersion values. + */ + public static Collection values() { + return values(TlsVersion.class); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Topics.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Topics.java new file mode 100644 index 000000000000..0251632433c0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/Topics.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; + +/** Resource collection API of Topics. */ +public interface Topics { + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName); + + /** + * Gets authorization rules for a topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization rules for a topic as paginated response with {@link PagedIterable}. + */ + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters, + Context context); + + /** + * Creates an authorization rule for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + SBAuthorizationRule createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + SBAuthorizationRuleInner parameters); + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule along with {@link Response}. + */ + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * Returns the specified authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace authorization rule. + */ + SBAuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * Deletes a topic authorization rule. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic along with {@link Response}. + */ + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + Context context); + + /** + * Gets the primary and secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the primary and secondary connection strings for the topic. + */ + AccessKeys listKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName); + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String along with {@link Response}. + */ + Response regenerateKeysWithResponse( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters, + Context context); + + /** + * Regenerates primary or secondary connection strings for the topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/ServiceBus Connection String. + */ + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String topicName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Gets all the topics in a namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains + * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting + * point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the topics in a namespace as paginated response with {@link PagedIterable}. + */ + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 topicName, Context context); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String namespaceName, String topicName); + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String topicName, Context context); + + /** + * Returns a description for the specified topic. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param topicName The topic name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource. + */ + SBTopic get(String resourceGroupName, String namespaceName, String topicName); + + /** + * Returns a description for the specified topic. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response}. + */ + SBTopic getById(String id); + + /** + * Returns a description for the specified topic. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of topic resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a topic from the specified namespace and resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SBTopic resource. + * + * @param name resource name. + * @return the first stage of the new SBTopic definition. + */ + SBTopic.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UnavailableReason.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UnavailableReason.java new file mode 100644 index 000000000000..0b4dde1e2e15 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UnavailableReason.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Specifies the reason for the unavailability of the service. */ +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) { + if (value == null) { + return null; + } + UnavailableReason[] items = UnavailableReason.values(); + for (UnavailableReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentity.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..04b0f464a872 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recognized Dictionary value. */ +@Immutable +public class UserAssignedIdentity { + /* + * 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; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: Principal Id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: Client Id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentityProperties.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentityProperties.java new file mode 100644 index 000000000000..d4cca31e16c6 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/UserAssignedIdentityProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserAssignedIdentityProperties model. */ +@Fluent +public final class UserAssignedIdentityProperties { + /* + * ARM ID of user Identity selected for encryption + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /** Creates an instance of UserAssignedIdentityProperties class. */ + public UserAssignedIdentityProperties() { + } + + /** + * Get the userAssignedIdentity property: ARM ID of user Identity selected for encryption. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: ARM ID of user Identity selected for encryption. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the UserAssignedIdentityProperties object itself. + */ + public UserAssignedIdentityProperties withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/package-info.java new file mode 100644 index 000000000000..a9cf3b90b88f --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for ServiceBusManagementClient. Azure Service Bus client for managing Namespace. + */ +package com.azure.resourcemanager.servicebus.generated.models; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/package-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/package-info.java new file mode 100644 index 000000000000..1da8dcb30ba0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/com/azure/resourcemanager/servicebus/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ServiceBusManagementClient. Azure Service Bus client for managing Namespace. */ +package com.azure.resourcemanager.servicebus.generated; diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/module-info.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/module-info.java new file mode 100644 index 000000000000..5d613af98fdb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.servicebus.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.servicebus.generated; + exports com.azure.resourcemanager.servicebus.generated.fluent; + exports com.azure.resourcemanager.servicebus.generated.fluent.models; + exports com.azure.resourcemanager.servicebus.generated.models; + + opens com.azure.resourcemanager.servicebus.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.servicebus.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsBreakPairingSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsBreakPairingSamples.java new file mode 100644 index 000000000000..94997ca9f970 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs BreakPairing. */ +public final class DisasterRecoveryConfigsBreakPairingSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json + */ + /** + * Sample code: SBEHAliasBreakPairing. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBEHAliasBreakPairing(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .breakPairingWithResponse( + "ardsouzatestRG", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..28928e691348 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; + +/** Samples for DisasterRecoveryConfigs CheckNameAvailability. */ +public final class DisasterRecoveryConfigsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json + */ + /** + * Sample code: AliasNameAvailability. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void aliasNameAvailability(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .checkNameAvailabilityWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + new CheckNameAvailability().withName("sdk-DisasterRecovery-9474"), + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..66667d51413e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.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.servicebus.generated.generated; + +/** Samples for DisasterRecoveryConfigs CreateOrUpdate. */ +public final class DisasterRecoveryConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasCreate.json + */ + /** + * Sample code: SBAliasCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .define("sdk-Namespace-8860") + .withExistingNamespace("ardsouzatestRG", "sdk-Namespace-8860") + .withPartnerNamespace("sdk-Namespace-37") + .withAlternateName("alternameforAlias-Namespace-8860") + .create(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsDeleteSamples.java new file mode 100644 index 000000000000..9138d5534162 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsDeleteSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Delete. */ +public final class DisasterRecoveryConfigsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasDelete.json + */ + /** + * Sample code: SBAliasDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .deleteWithResponse("SouthCentralUS", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsFailOverSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsFailOverSamples.java new file mode 100644 index 000000000000..7880db759c81 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs FailOver. */ +public final class DisasterRecoveryConfigsFailOverSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasFailOver.json + */ + /** + * Sample code: SBAliasFailOver. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasFailOver(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .failOverWithResponse( + "ardsouzatestRG", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", null, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java new file mode 100644 index 000000000000..3fec32d5873b --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs GetAuthorizationRule. */ +public final class DisasterRecoveryConfigsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json + */ + /** + * Sample code: DisasterRecoveryConfigsAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void disasterRecoveryConfigsAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .getAuthorizationRuleWithResponse( + "exampleResourceGroup", + "sdk-Namespace-9080", + "sdk-DisasterRecovery-4879", + "sdk-Authrules-4879", + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsGetSamples.java new file mode 100644 index 000000000000..70e51324bccc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs Get. */ +public final class DisasterRecoveryConfigsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasGet.json + */ + /** + * Sample code: SBAliasGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .getWithResponse("ardsouzatestRG", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java new file mode 100644 index 000000000000..6e776bdafb34 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListAuthorizationRules. */ +public final class DisasterRecoveryConfigsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .listAuthorizationRules( + "exampleResourceGroup", "sdk-Namespace-9080", "sdk-DisasterRecovery-4047", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListKeysSamples.java new file mode 100644 index 000000000000..7e15da8c701d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs ListKeys. */ +public final class DisasterRecoveryConfigsListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json + */ + /** + * Sample code: DisasterRecoveryConfigsAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void disasterRecoveryConfigsAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .disasterRecoveryConfigs() + .listKeysWithResponse( + "exampleResourceGroup", + "sdk-Namespace-2702", + "sdk-DisasterRecovery-4047", + "sdk-Authrules-1746", + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/DisasterRecoveryConfigsListSamples.java new file mode 100644 index 000000000000..0262a78a7b5d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DisasterRecoveryConfigs List. */ +public final class DisasterRecoveryConfigsListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasList.json + */ + /** + * Sample code: SBAliasList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void sBAliasList(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.disasterRecoveryConfigs().list("ardsouzatestRG", "sdk-Namespace-8860", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsCompleteMigrationSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsCompleteMigrationSamples.java new file mode 100644 index 000000000000..1e910c1306ec --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsCompleteMigrationSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs CompleteMigration. */ +public final class MigrationConfigsCompleteMigrationSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json + */ + /** + * Sample code: MigrationConfigurationsCompleteMigration. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsCompleteMigration( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .completeMigrationWithResponse( + "ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsCreateAndStartMigrationSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsCreateAndStartMigrationSamples.java new file mode 100644 index 000000000000..6998a7925a01 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsCreateAndStartMigrationSamples.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.servicebus.generated.generated; + +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs CreateAndStartMigration. */ +public final class MigrationConfigsCreateAndStartMigrationSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json + */ + /** + * Sample code: MigrationConfigurationsStartMigration. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsStartMigration( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .define(MigrationConfigurationName.DEFAULT) + .withExistingNamespace("ResourceGroup", "sdk-Namespace-41") + .withTargetNamespace( + "/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028") + .withPostMigrationName("sdk-PostMigration-5919") + .create(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsDeleteSamples.java new file mode 100644 index 000000000000..86753a9939ce --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsDeleteSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs Delete. */ +public final class MigrationConfigsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json + */ + /** + * Sample code: MigrationConfigurationsDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .deleteWithResponse("ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsGetSamples.java new file mode 100644 index 000000000000..0acbcb3ee55d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsGetSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs Get. */ +public final class MigrationConfigsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationGet.json + */ + /** + * Sample code: MigrationConfigurationsGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .getWithResponse("ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsListSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsListSamples.java new file mode 100644 index 000000000000..3d7bb986c848 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsListSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for MigrationConfigs List. */ +public final class MigrationConfigsListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationList.json + */ + /** + * Sample code: MigrationConfigurationsList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsList( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.migrationConfigs().list("ResourceGroup", "sdk-Namespace-9259", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsRevertSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsRevertSamples.java new file mode 100644 index 000000000000..a43ce5b1de25 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/MigrationConfigsRevertSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.MigrationConfigurationName; + +/** Samples for MigrationConfigs Revert. */ +public final class MigrationConfigsRevertSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json + */ + /** + * Sample code: MigrationConfigurationsRevert. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void migrationConfigurationsRevert( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .migrationConfigs() + .revertWithResponse("ResourceGroup", "sdk-Namespace-41", MigrationConfigurationName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCheckNameAvailabilitySamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..9e5bb4e08936 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.CheckNameAvailability; + +/** Samples for Namespaces CheckNameAvailability. */ +public final class NamespacesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json + */ + /** + * Sample code: NameSpaceCheckNameAvailability. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceCheckNameAvailability( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + new CheckNameAvailability().withName("sdk-Namespace-2924"), Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java new file mode 100644 index 000000000000..9ecdc63b6a26 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ +public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .defineAuthorizationRule("sdk-AuthRules-1788") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-6914") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) + .create(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java new file mode 100644 index 000000000000..ce772b5a051c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.servicebus.generated.models.DefaultAction; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetIpRules; +import com.azure.resourcemanager.servicebus.generated.models.NWRuleSetVirtualNetworkRules; +import com.azure.resourcemanager.servicebus.generated.models.NetworkRuleIpAction; +import com.azure.resourcemanager.servicebus.generated.models.Subnet; +import java.util.Arrays; + +/** Samples for Namespaces CreateOrUpdateNetworkRuleSet. */ +public final class NamespacesCreateOrUpdateNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceNetworkRuleSetCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .createOrUpdateNetworkRuleSetWithResponse( + "ResourceGroup", + "sdk-Namespace-6019", + new NetworkRuleSetInner() + .withDefaultAction(DefaultAction.DENY) + .withVirtualNetworkRules( + Arrays + .asList( + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2")) + .withIgnoreMissingVnetServiceEndpoint(true), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3")) + .withIgnoreMissingVnetServiceEndpoint(false), + new NWRuleSetVirtualNetworkRules() + .withSubnet( + new Subnet() + .withId( + "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/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/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..52084c4e3ca3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.resourcemanager.servicebus.generated.models.SBSku; +import com.azure.resourcemanager.servicebus.generated.models.SkuName; +import com.azure.resourcemanager.servicebus.generated.models.SkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces CreateOrUpdate. */ +public final class NamespacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceCreate.json + */ + /** + * Sample code: NameSpaceCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .define("sdk-Namespace2924") + .withRegion("South Central US") + .withExistingResourceGroup("ArunMonocle") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSku(new SBSku().withName(SkuName.PREMIUM).withTier(SkuTier.PREMIUM).withCapacity(4)) + .withPremiumMessagingPartitions(2) + .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/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesDeleteAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesDeleteAuthorizationRuleSamples.java new file mode 100644 index 000000000000..11a51d220a7d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces DeleteAuthorizationRule. */ +public final class NamespacesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-namespace-6914", "sdk-AuthRules-1788", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesDeleteSamples.java new file mode 100644 index 000000000000..46728213b12e --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces Delete. */ +public final class NamespacesDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceDelete.json + */ + /** + * Sample code: NameSpaceDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().delete("ArunMonocle", "sdk-Namespace-3285", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesGetAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesGetAuthorizationRuleSamples.java new file mode 100644 index 000000000000..ecc18989ed3c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetAuthorizationRule. */ +public final class NamespacesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .getAuthorizationRuleWithResponse("ArunMonocle", "sdk-Namespace-6914", "sdk-AuthRules-1788", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesGetByResourceGroupSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..22354e4913db --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetByResourceGroup. */ +public final class NamespacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceGet.json + */ + /** + * Sample code: NameSpaceGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().getByResourceGroupWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesGetNetworkRuleSetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesGetNetworkRuleSetSamples.java new file mode 100644 index 000000000000..e39817b8dfbe --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetNetworkRuleSet. */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceNetworkRuleSetGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().getNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListAuthorizationRulesSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListAuthorizationRulesSamples.java new file mode 100644 index 000000000000..fe9c7bef263d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListAuthorizationRulesSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListAuthorizationRules. */ +public final class NamespacesListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().listAuthorizationRules("ArunMonocle", "sdk-Namespace-6914", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListByResourceGroupSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListByResourceGroupSamples.java new file mode 100644 index 000000000000..34ae4d35d693 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListByResourceGroup. */ +public final class NamespacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceListByResourceGroup.json + */ + /** + * Sample code: NameSpaceListByResourceGroup. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceListByResourceGroup( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().listByResourceGroup("ArunMonocle", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListKeysSamples.java new file mode 100644 index 000000000000..67c35aa6a3e4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListKeys. */ +public final class NamespacesListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .listKeysWithResponse("ArunMonocle", "sdk-namespace-6914", "sdk-AuthRules-1788", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListNetworkRuleSetsSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListNetworkRuleSetsSamples.java new file mode 100644 index 000000000000..16caeefaf562 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListNetworkRuleSetsSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces ListNetworkRuleSets. */ +public final class NamespacesListNetworkRuleSetsSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceNetworkRuleSetList( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().listNetworkRuleSets("ResourceGroup", "sdk-Namespace-6019", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListSamples.java new file mode 100644 index 000000000000..07faed7600cc --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesListSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces List. */ +public final class NamespacesListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceList.json + */ + /** + * Sample code: NameSpaceList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceList(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.namespaces().list(Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesRegenerateKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesRegenerateKeysSamples.java new file mode 100644 index 000000000000..3e647a838a23 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.KeyType; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Namespaces RegenerateKeys. */ +public final class NamespacesRegenerateKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: NameSpaceAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .namespaces() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-namespace-6914", + "sdk-AuthRules-1788", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesUpdateSamples.java new file mode 100644 index 000000000000..59daeb28bdc1 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/NamespacesUpdateSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.SBNamespace; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Namespaces Update. */ +public final class NamespacesUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceUpdate.json + */ + /** + * Sample code: NameSpaceUpdate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceUpdate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + SBNamespace resource = + manager + .namespaces() + .getByResourceGroupWithResponse("ArunMonocle", "sdk-Namespace-3285", 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/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/OperationsListSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/OperationsListSamples.java new file mode 100644 index 000000000000..28bfcd9d91f0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/SBOperations_List.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void operationsList(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..824a8fa57ca2 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.resourcemanager.servicebus.generated.models.ConnectionState; +import com.azure.resourcemanager.servicebus.generated.models.EndPointProvisioningState; +import com.azure.resourcemanager.servicebus.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.servicebus.generated.models.PrivateLinkConnectionStatus; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateEndPointConnectionCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .privateEndpointConnections() + .define("privateEndpointConnectionName") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-2924") + .withPrivateEndpoint( + new PrivateEndpoint() + .withId( + "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.REJECTED).withDescription("testing")) + .withProvisioningState(EndPointProvisioningState.SUCCEEDED) + .create(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..6f4b16e92bf4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateEndPointConnectionDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .privateEndpointConnections() + .delete("ArunMonocle", "sdk-Namespace-3285", "928c44d5-b7c6-423b-b6fa-811e0c27b3e0", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..90d95bbd5eae --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsGetSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateEndPointConnectionGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "SDK-ServiceBus-4794", "sdk-Namespace-5828", "privateEndpointConnectionName", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..22fad6e184eb --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json + */ + /** + * Sample code: NameSpaceCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpaceCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.privateEndpointConnections().list("SDK-ServiceBus-4794", "sdk-Namespace-5828", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateLinkResourcesGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..68da3876c1aa --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateLinkResourcesGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void nameSpacePrivateLinkResourcesGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.privateLinkResources().getWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesCreateOrUpdateAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesCreateOrUpdateAuthorizationRuleSamples.java new file mode 100644 index 000000000000..8566d8b2fd0a --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesCreateOrUpdateAuthorizationRuleSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Queues CreateOrUpdateAuthorizationRule. */ +public final class QueuesCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleCreate.json + */ + /** + * Sample code: QueueAuthorizationRuleCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .createOrUpdateAuthorizationRuleWithResponse( + "ArunMonocle", + "sdk-Namespace-7982", + "sdk-Queues-2317", + "sdk-AuthRules-5800", + new SBAuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..aa55cbd935ff --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesCreateOrUpdateSamples.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.servicebus.generated.generated; + +/** Samples for Queues CreateOrUpdate. */ +public final class QueuesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueCreate.json + */ + /** + * Sample code: QueueCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .define("sdk-Queues-5647") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-3174") + .withEnablePartitioning(true) + .create(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesDeleteAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesDeleteAuthorizationRuleSamples.java new file mode 100644 index 000000000000..4c59d5fdab85 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesDeleteAuthorizationRuleSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues DeleteAuthorizationRule. */ +public final class QueuesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleDelete.json + */ + /** + * Sample code: QueueAuthorizationRuleDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-namespace-7982", "sdk-Queues-2317", "sdk-AuthRules-5800", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesDeleteSamples.java new file mode 100644 index 000000000000..d683717a1001 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesDeleteSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues Delete. */ +public final class QueuesDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueDelete.json + */ + /** + * Sample code: QueueDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().deleteWithResponse("ArunMonocle", "sdk-Namespace-183", "sdk-Queues-8708", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesGetAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesGetAuthorizationRuleSamples.java new file mode 100644 index 000000000000..dd3f3b6c0540 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesGetAuthorizationRuleSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues GetAuthorizationRule. */ +public final class QueuesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleGet.json + */ + /** + * Sample code: QueueAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .getAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-7982", "sdk-Queues-2317", "sdk-AuthRules-5800", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesGetSamples.java new file mode 100644 index 000000000000..f2b07ce04dc9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesGetSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues Get. */ +public final class QueuesGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueGet.json + */ + /** + * Sample code: QueueGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().getWithResponse("ArunMonocle", "sdk-Namespace-3174", "sdk-Queues-5647", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListAuthorizationRulesSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListAuthorizationRulesSamples.java new file mode 100644 index 000000000000..e95146d75246 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListAuthorizationRulesSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues ListAuthorizationRules. */ +public final class QueuesListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleListAll.json + */ + /** + * Sample code: QueueAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().listAuthorizationRules("ArunMonocle", "sdk-Namespace-7982", "sdk-Queues-2317", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListByNamespaceSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListByNamespaceSamples.java new file mode 100644 index 000000000000..966b19e9a064 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListByNamespaceSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues ListByNamespace. */ +public final class QueuesListByNamespaceSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueListByNameSpace.json + */ + /** + * Sample code: QueueListByNameSpace. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueListByNameSpace(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.queues().listByNamespace("ArunMonocle", "sdk-Namespace-3174", null, null, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListKeysSamples.java new file mode 100644 index 000000000000..9b67418fb206 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesListKeysSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queues ListKeys. */ +public final class QueuesListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleListKey.json + */ + /** + * Sample code: QueueAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .listKeysWithResponse( + "ArunMonocle", "sdk-namespace-7982", "sdk-Queues-2317", "sdk-AuthRules-5800", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesRegenerateKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesRegenerateKeysSamples.java new file mode 100644 index 000000000000..f32fb09bf4fa --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/QueuesRegenerateKeysSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.KeyType; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Queues RegenerateKeys. */ +public final class QueuesRegenerateKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: QueueAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void queueAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .queues() + .regenerateKeysWithResponse( + "ArunMonocle", + "sdk-namespace-7982", + "sdk-Queues-2317", + "sdk-AuthRules-5800", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..22230f695bbe --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesCreateOrUpdateSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.resourcemanager.servicebus.generated.models.CorrelationFilter; +import com.azure.resourcemanager.servicebus.generated.models.FilterType; +import com.azure.resourcemanager.servicebus.generated.models.SqlFilter; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Rules CreateOrUpdate. */ +public final class RulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate_CorrelationFilter.json + */ + /** + * Sample code: RulesCreateCorrelationFilter. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesCreateCorrelationFilter( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .define("sdk-Rules-6571") + .withExistingResourceGroup( + "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691") + .withFilterType(FilterType.CORRELATION_FILTER) + .withCorrelationFilter(new CorrelationFilter().withProperties(mapOf("topicHint", "Crop"))) + .create(); + } + + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate.json + */ + /** + * Sample code: RulesCreateOrUpdate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesCreateOrUpdate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .define("sdk-Rules-6571") + .withExistingResourceGroup( + "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691") + .create(); + } + + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate_SqlFilter.json + */ + /** + * Sample code: RulesCreateSqlFilter. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesCreateSqlFilter(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .define("sdk-Rules-6571") + .withExistingResourceGroup( + "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691") + .withFilterType(FilterType.SQL_FILTER) + .withSqlFilter(new SqlFilter().withSqlExpression("myproperty=test")) + .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/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesDeleteSamples.java new file mode 100644 index 000000000000..5400f1eea41c --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesDeleteSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Rules Delete. */ +public final class RulesDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleDelete.json + */ + /** + * Sample code: RulesDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .deleteWithResponse( + "ArunMonocle", + "sdk-Namespace-1319", + "sdk-Topics-2081", + "sdk-Subscriptions-8691", + "sdk-Rules-6571", + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesGetSamples.java new file mode 100644 index 000000000000..e234d1c78a5d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesGetSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Rules Get. */ +public final class RulesGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleGet.json + */ + /** + * Sample code: RulesGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .getWithResponse( + "ArunMonocle", + "sdk-Namespace-1319", + "sdk-Topics-2081", + "sdk-Subscriptions-8691", + "sdk-Rules-6571", + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesListBySubscriptionsSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesListBySubscriptionsSamples.java new file mode 100644 index 000000000000..4c299c5d9ed8 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/RulesListBySubscriptionsSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Rules ListBySubscriptions. */ +public final class RulesListBySubscriptionsSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleListBySubscription.json + */ + /** + * Sample code: RulesListBySubscriptions. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void rulesListBySubscriptions( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .rules() + .listBySubscriptions( + "ArunMonocle", + "sdk-Namespace-1319", + "sdk-Topics-2081", + "sdk-Subscriptions-8691", + null, + null, + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..d94042c8e071 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBSubscriptionInner; + +/** Samples for Subscriptions CreateOrUpdate. */ +public final class SubscriptionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionCreate.json + */ + /** + * Sample code: SubscriptionCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .createOrUpdateWithResponse( + "ResourceGroup", + "sdk-Namespace-1349", + "sdk-Topics-8740", + "sdk-Subscriptions-2178", + new SBSubscriptionInner().withEnableBatchedOperations(true), + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsDeleteSamples.java new file mode 100644 index 000000000000..694d5b33f521 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsDeleteSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Subscriptions Delete. */ +public final class SubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionDelete.json + */ + /** + * Sample code: SubscriptionDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .deleteWithResponse( + "ResourceGroup", "sdk-Namespace-5882", "sdk-Topics-1804", "sdk-Subscriptions-3670", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsGetSamples.java new file mode 100644 index 000000000000..9b595661cc92 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsGetSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Subscriptions Get. */ +public final class SubscriptionsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionGet.json + */ + /** + * Sample code: SubscriptionGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .getWithResponse( + "ResourceGroup", "sdk-Namespace-1349", "sdk-Topics-8740", "sdk-Subscriptions-2178", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsListByTopicSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsListByTopicSamples.java new file mode 100644 index 000000000000..2d0f40c03d52 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/SubscriptionsListByTopicSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Subscriptions ListByTopic. */ +public final class SubscriptionsListByTopicSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionListByTopic.json + */ + /** + * Sample code: SubscriptionListByTopic. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void subscriptionListByTopic( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .subscriptions() + .listByTopic("ResourceGroup", "sdk-Namespace-1349", "sdk-Topics-8740", null, null, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsCreateOrUpdateAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsCreateOrUpdateAuthorizationRuleSamples.java new file mode 100644 index 000000000000..404c76cd9051 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsCreateOrUpdateAuthorizationRuleSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.fluent.models.SBAuthorizationRuleInner; +import com.azure.resourcemanager.servicebus.generated.models.AccessRights; +import java.util.Arrays; + +/** Samples for Topics CreateOrUpdateAuthorizationRule. */ +public final class TopicsCreateOrUpdateAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleCreate.json + */ + /** + * Sample code: TopicAuthorizationRuleCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleCreate( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .createOrUpdateAuthorizationRuleWithResponse( + "ArunMonocle", + "sdk-Namespace-6261", + "sdk-Topics-1984", + "sdk-AuthRules-4310", + new SBAuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsCreateOrUpdateSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..9c387d8073b4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsCreateOrUpdateSamples.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.servicebus.generated.generated; + +/** Samples for Topics CreateOrUpdate. */ +public final class TopicsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicCreate.json + */ + /** + * Sample code: TopicCreate. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicCreate(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .define("sdk-Topics-5488") + .withExistingNamespace("ArunMonocle", "sdk-Namespace-1617") + .withEnableExpress(true) + .create(); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsDeleteAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsDeleteAuthorizationRuleSamples.java new file mode 100644 index 000000000000..77d4b5bfb05d --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsDeleteAuthorizationRuleSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics DeleteAuthorizationRule. */ +public final class TopicsDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleDelete.json + */ + /** + * Sample code: TopicAuthorizationRuleDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleDelete( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .deleteAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", "sdk-AuthRules-4310", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsDeleteSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsDeleteSamples.java new file mode 100644 index 000000000000..66ebe57be4a9 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsDeleteSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics Delete. */ +public final class TopicsDeleteSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicDelete.json + */ + /** + * Sample code: TopicDelete. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicDelete(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().deleteWithResponse("ArunMonocle", "sdk-Namespace-1617", "sdk-Topics-5488", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsGetAuthorizationRuleSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsGetAuthorizationRuleSamples.java new file mode 100644 index 000000000000..846cd4711bb0 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsGetAuthorizationRuleSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics GetAuthorizationRule. */ +public final class TopicsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleGet.json + */ + /** + * Sample code: TopicAuthorizationRuleGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleGet( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .getAuthorizationRuleWithResponse( + "ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", "sdk-AuthRules-4310", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsGetSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsGetSamples.java new file mode 100644 index 000000000000..d7b0ba8d0124 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsGetSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics Get. */ +public final class TopicsGetSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicGet.json + */ + /** + * Sample code: TopicGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().getWithResponse("ArunMonocle", "sdk-Namespace-1617", "sdk-Topics-5488", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListAuthorizationRulesSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListAuthorizationRulesSamples.java new file mode 100644 index 000000000000..d8f84a7dce81 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListAuthorizationRulesSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics ListAuthorizationRules. */ +public final class TopicsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleListAll.json + */ + /** + * Sample code: TopicAuthorizationRuleListAll. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleListAll( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().listAuthorizationRules("ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListByNamespaceSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListByNamespaceSamples.java new file mode 100644 index 000000000000..228486b863d3 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListByNamespaceSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics ListByNamespace. */ +public final class TopicsListByNamespaceSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicListByNameSpace.json + */ + /** + * Sample code: TopicGet. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicGet(com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager.topics().listByNamespace("Default-ServiceBus-WestUS", "sdk-Namespace-1617", null, null, Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListKeysSamples.java new file mode 100644 index 000000000000..219daf5e98a5 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsListKeysSamples.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.servicebus.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Topics ListKeys. */ +public final class TopicsListKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleListKey.json + */ + /** + * Sample code: TopicAuthorizationRuleListKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleListKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .listKeysWithResponse( + "Default-ServiceBus-WestUS", "sdk-Namespace8408", "sdk-Topics2075", "sdk-Authrules5067", Context.NONE); + } +} diff --git a/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsRegenerateKeysSamples.java b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsRegenerateKeysSamples.java new file mode 100644 index 000000000000..3522b44449e4 --- /dev/null +++ b/sdk/servicebus/azure-resourcemanager-servicebus-generated/src/samples/java/com/azure/resourcemanager/servicebus/generated/generated/TopicsRegenerateKeysSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicebus.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicebus.generated.models.KeyType; +import com.azure.resourcemanager.servicebus.generated.models.RegenerateAccessKeyParameters; + +/** Samples for Topics RegenerateKeys. */ +public final class TopicsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: TopicAuthorizationRuleRegenerateKey. + * + * @param manager Entry point to ServiceBusManager. + */ + public static void topicAuthorizationRuleRegenerateKey( + com.azure.resourcemanager.servicebus.generated.ServiceBusManager manager) { + manager + .topics() + .regenerateKeysWithResponse( + "Default-ServiceBus-WestUS", + "sdk-Namespace8408", + "sdk-Topics2075", + "sdk-Authrules5067", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} diff --git a/sdk/servicebus/ci.yml b/sdk/servicebus/ci.yml index 587aac10c6f4..b067293078f5 100644 --- a/sdk/servicebus/ci.yml +++ b/sdk/servicebus/ci.yml @@ -52,11 +52,13 @@ extends: - name: azure-messaging-servicebus groupId: com.azure safeName: azuremessagingservicebus + - name: azure-resourcemanager-servicebus-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerservicebusgenerated AdditionalModules: - name: azure-messaging-servicebus-track1-perf groupId: com.azure - name: azure-messaging-servicebus-track2-perf groupId: com.azure - # required by the above perf libraries - name: perf-test-core groupId: com.azure diff --git a/sdk/servicebus/pom.xml b/sdk/servicebus/pom.xml index db45619161ea..37824c54297a 100644 --- a/sdk/servicebus/pom.xml +++ b/sdk/servicebus/pom.xml @@ -9,11 +9,12 @@ 1.0.0 - microsoft-azure-servicebus - azure-messaging-servicebus - azure-messaging-servicebus-stress - azure-messaging-servicebus-track1-perf - azure-messaging-servicebus-track2-perf + azure-messaging-servicebus + azure-messaging-servicebus-stress + azure-messaging-servicebus-track1-perf + azure-messaging-servicebus-track2-perf + azure-resourcemanager-servicebus-generated + microsoft-azure-servicebus