diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md index f0d3470b4877..b56bdaaa44ab 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2024-03-12) + +- Azure Resource Manager NotificationHubs client library for Java. This package contains Microsoft Azure SDK for NotificationHubs Management SDK. Microsoft Notification Hubs Resource Provider REST API. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/README.md b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/README.md index e2f0444c7ae9..ea3c28157037 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/README.md +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/README.md @@ -2,7 +2,7 @@ Azure Resource Manager NotificationHubs client library for Java. -This package contains Microsoft Azure SDK for NotificationHubs Management SDK. Azure NotificationHub client. Package tag package-2017-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for NotificationHubs Management SDK. Microsoft Notification Hubs Resource Provider REST API. Package tag package-preview-2023-10. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-notificationhubs - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[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 configure of following environment variables. +By default, Microsoft Entra ID 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 environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,20 +83,25 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +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/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fnotificationhubs%2Fazure-resourcemanager-notificationhubs%2FREADME.png) diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/SAMPLE.md b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/SAMPLE.md index 973de5b2e525..006bf347cc8c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/SAMPLE.md +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/SAMPLE.md @@ -10,12 +10,13 @@ - [DeleteAuthorizationRule](#namespaces_deleteauthorizationrule) - [GetAuthorizationRule](#namespaces_getauthorizationrule) - [GetByResourceGroup](#namespaces_getbyresourcegroup) +- [GetPnsCredentials](#namespaces_getpnscredentials) - [List](#namespaces_list) - [ListAuthorizationRules](#namespaces_listauthorizationrules) - [ListByResourceGroup](#namespaces_listbyresourcegroup) - [ListKeys](#namespaces_listkeys) -- [Patch](#namespaces_patch) - [RegenerateKeys](#namespaces_regeneratekeys) +- [Update](#namespaces_update) ## NotificationHubs @@ -31,34 +32,44 @@ - [List](#notificationhubs_list) - [ListAuthorizationRules](#notificationhubs_listauthorizationrules) - [ListKeys](#notificationhubs_listkeys) -- [Patch](#notificationhubs_patch) - [RegenerateKeys](#notificationhubs_regeneratekeys) +- [Update](#notificationhubs_update) ## Operations - [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [GetGroupId](#privateendpointconnections_getgroupid) +- [List](#privateendpointconnections_list) +- [ListGroupIds](#privateendpointconnections_listgroupids) +- [Update](#privateendpointconnections_update) ### Namespaces_CheckAvailability ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -/** Samples for Namespaces CheckAvailability. */ +/** + * Samples for Namespaces CheckAvailability. + */ public final class NamespacesCheckAvailabilitySamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/CheckAvailability.json */ /** - * Sample code: NameSpaceCheckNameAvailability. - * + * Sample code: Namespaces_CheckAvailability. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceCheckNameAvailability( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .checkAvailabilityWithResponse( - new CheckAvailabilityParameters().withName("sdk-Namespace-2924"), Context.NONE); + public static void + namespacesCheckAvailability(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().checkAvailabilityWithResponse( + new CheckAvailabilityParameters().withName("sdk-Namespace-2924"), com.azure.core.util.Context.NONE); } } ``` @@ -66,32 +77,48 @@ public final class NamespacesCheckAvailabilitySamples { ### Namespaces_CreateOrUpdate ```java +import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.IpRule; +import com.azure.resourcemanager.notificationhubs.models.NamespaceProperties; +import com.azure.resourcemanager.notificationhubs.models.NetworkAcls; +import com.azure.resourcemanager.notificationhubs.models.PublicInternetAuthorizationRule; import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.SkuName; +import com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Namespaces CreateOrUpdate. */ +/** + * Samples for Namespaces CreateOrUpdate. + */ public final class NamespacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/CreateOrUpdate.json */ /** - * Sample code: NameSpaceCreate. - * + * Sample code: Namespaces_CreateOrUpdate. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceCreate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .define("nh-sdk-ns") - .withLocation("South Central US") - .withExistingResourceGroup("5ktrial") + public static void + namespacesCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().define("nh-sdk-ns").withRegion("South Central US").withExistingResourceGroup("5ktrial") + .withSku( + new Sku().withName(SkuName.STANDARD).withTier("Standard")) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + .withProperties(new NamespaceProperties().withZoneRedundancy(ZoneRedundancyPreference.ENABLED) + .withNetworkAcls(new NetworkAcls() + .withIpRules(Arrays.asList(new IpRule().withIpMask("185.48.100.00/24") + .withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.SEND, AccessRights.LISTEN)))) + .withPublicNetworkRule( + new PublicInternetAuthorizationRule().withRights(Arrays.asList(AccessRights.LISTEN))))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -108,30 +135,32 @@ public final class NamespacesCreateOrUpdateSamples { ### Namespaces_CreateOrUpdateAuthorizationRule ```java -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; +import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties; import java.util.Arrays; -/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ +/** + * Samples for Namespaces CreateOrUpdateAuthorizationRule. + */ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleCreateOrUpdate.json */ /** - * Sample code: NameSpaceAuthorizationRuleCreate. - * + * Sample code: Namespaces_CreateOrUpdateAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleCreate( + public static void namespacesCreateOrUpdateAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .defineAuthorizationRule("sdk-AuthRules-1788") - .withExistingNamespace("5ktrial", "nh-sdk-ns") - .withProperties( - new SharedAccessAuthorizationRuleProperties() - .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))) - .create(); + manager.namespaces().createOrUpdateAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "sdk-AuthRules-1788", + new SharedAccessAuthorizationRuleResourceInner() + .withProperties(new SharedAccessAuthorizationRuleProperties() + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))), + com.azure.core.util.Context.NONE); } } ``` @@ -139,20 +168,23 @@ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { ### Namespaces_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces Delete. */ +/** + * Samples for Namespaces Delete. + */ public final class NamespacesDeleteSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/Delete.json */ /** - * Sample code: NameSpaceDelete. - * + * Sample code: Namespaces_Delete. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().delete("5ktrial", "nh-sdk-ns", Context.NONE); + public static void namespacesDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().deleteByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", + com.azure.core.util.Context.NONE); } } ``` @@ -160,23 +192,24 @@ public final class NamespacesDeleteSamples { ### Namespaces_DeleteAuthorizationRule ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces DeleteAuthorizationRule. */ +/** + * Samples for Namespaces DeleteAuthorizationRule. + */ public final class NamespacesDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleDelete.json */ /** - * Sample code: NameSpaceAuthorizationRuleDelete. - * + * Sample code: Namespaces_DeleteAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleDelete( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", Context.NONE); + public static void + namespacesDeleteAuthorizationRule(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + com.azure.core.util.Context.NONE); } } ``` @@ -184,23 +217,24 @@ public final class NamespacesDeleteAuthorizationRuleSamples { ### Namespaces_GetAuthorizationRule ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces GetAuthorizationRule. */ +/** + * Samples for Namespaces GetAuthorizationRule. + */ public final class NamespacesGetAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleGet.json */ /** - * Sample code: NameSpaceAuthorizationRuleGet. - * + * Sample code: Namespaces_GetAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleGet( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", Context.NONE); + public static void + namespacesGetAuthorizationRule(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + com.azure.core.util.Context.NONE); } } ``` @@ -208,41 +242,69 @@ public final class NamespacesGetAuthorizationRuleSamples { ### Namespaces_GetByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces GetByResourceGroup. */ +/** + * Samples for Namespaces GetByResourceGroup. + */ public final class NamespacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/Get.json */ /** - * Sample code: NameSpaceGet. - * + * Sample code: Namespaces_Get. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", Context.NONE); + public static void namespacesGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); } } ``` -### Namespaces_List +### Namespaces_GetPnsCredentials ```java -import com.azure.core.util.Context; +/** + * Samples for Namespaces GetPnsCredentials. + */ +public final class NamespacesGetPnsCredentialsSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PnsCredentialsGet.json + */ + /** + * Sample code: Namespaces_GetPnsCredentials. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + namespacesGetPnsCredentials(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); + } +} +``` + +### Namespaces_List -/** Samples for Namespaces List. */ +```java +/** + * Samples for Namespaces List. + */ public final class NamespacesListSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/ListBySubscription.json */ /** - * Sample code: NameSpaceList. - * + * Sample code: Namespaces_ListAll. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().list(Context.NONE); + public static void namespacesListAll(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().list(null, null, com.azure.core.util.Context.NONE); } } ``` @@ -250,21 +312,23 @@ public final class NamespacesListSamples { ### Namespaces_ListAuthorizationRules ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces ListAuthorizationRules. */ +/** + * Samples for Namespaces ListAuthorizationRules. + */ public final class NamespacesListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleList.json */ /** - * Sample code: NameSpaceAuthorizationRuleListAll. - * + * Sample code: Namespaces_ListAuthorizationRules. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleListAll( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().listAuthorizationRules("5ktrial", "nh-sdk-ns", Context.NONE); + public static void + namespacesListAuthorizationRules(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listAuthorizationRules("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); } } ``` @@ -272,21 +336,22 @@ public final class NamespacesListAuthorizationRulesSamples { ### Namespaces_ListByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces ListByResourceGroup. */ +/** + * Samples for Namespaces ListByResourceGroup. + */ public final class NamespacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/ListByResourceGroup.json */ /** - * Sample code: NameSpaceListByResourceGroup. - * + * Sample code: Namespaces_List. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceListByResourceGroup( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().listByResourceGroup("5ktrial", Context.NONE); + public static void namespacesList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listByResourceGroup("5ktrial", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -294,55 +359,93 @@ public final class NamespacesListByResourceGroupSamples { ### Namespaces_ListKeys ```java -import com.azure.core.util.Context; - -/** Samples for Namespaces ListKeys. */ +/** + * Samples for Namespaces ListKeys. + */ public final class NamespacesListKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleListKeys.json */ /** - * Sample code: NameSpaceAuthorizationRuleListKey. - * + * Sample code: Namespaces_ListKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleListKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().listKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", Context.NONE); + public static void namespacesListKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + com.azure.core.util.Context.NONE); + } +} +``` + +### Namespaces_RegenerateKeys + +```java +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyType; + +/** + * Samples for Namespaces RegenerateKeys. + */ +public final class NamespacesRegenerateKeysSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: Namespaces_RegenerateKeys. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + namespacesRegenerateKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + new PolicyKeyResource().withPolicyKey(PolicyKeyType.PRIMARY_KEY), com.azure.core.util.Context.NONE); } } ``` -### Namespaces_Patch +### Namespaces_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; +import com.azure.resourcemanager.notificationhubs.models.GcmCredentialProperties; +import com.azure.resourcemanager.notificationhubs.models.NamespaceProperties; import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentials; import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.SkuName; import java.util.HashMap; import java.util.Map; -/** Samples for Namespaces Patch. */ -public final class NamespacesPatchSamples { +/** + * Samples for Namespaces Update. + */ +public final class NamespacesUpdateSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/Update.json */ /** - * Sample code: NameSpaceUpdate. - * + * Sample code: Namespaces_Update. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - NamespaceResource resource = - manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + public static void namespacesUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + NamespaceResource resource = manager.namespaces() + .getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value3")).withSku(new Sku().withName(SkuName.FREE)) + .withProperties(new NamespaceProperties().withPnsCredentials( + new PnsCredentials().withGcmCredential(new GcmCredential().withProperties(new GcmCredentialProperties() + .withGcmEndpoint("https://fcm.googleapis.com/fcm/send").withGoogleApiKey("fakeTokenPlaceholder"))))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -356,61 +459,30 @@ public final class NamespacesPatchSamples { } ``` -### Namespaces_RegenerateKeys - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; - -/** Samples for Namespaces RegenerateKeys. */ -public final class NamespacesRegenerateKeysSamples { - /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json - */ - /** - * Sample code: NameSpaceAuthorizationRuleRegenerateKey. - * - * @param manager Entry point to NotificationHubsManager. - */ - public static void nameSpaceAuthorizationRuleRegenerateKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .regenerateKeysWithResponse( - "5ktrial", - "nh-sdk-ns", - "RootManageSharedAccessKey", - new PolicykeyResource().withPolicyKey("PrimaryKey"), - Context.NONE); - } -} -``` - ### NotificationHubs_CheckNotificationHubAvailability ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -/** Samples for NotificationHubs CheckNotificationHubAvailability. */ +/** + * Samples for NotificationHubs CheckNotificationHubAvailability. + */ public final class NotificationHubsCheckNotificationHubAvailabilitySamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/CheckAvailability.json */ /** - * Sample code: notificationHubCheckNameAvailability. - * + * Sample code: NotificationHubs_CheckNotificationHubAvailability. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubCheckNameAvailability( + public static void notificationHubsCheckNotificationHubAvailability( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .checkNotificationHubAvailabilityWithResponse( - "5ktrial", - "locp-newns", - new CheckAvailabilityParameters().withName("sdktest").withLocation("West Europe"), - Context.NONE); + manager.notificationHubs().checkNotificationHubAvailabilityWithResponse("5ktrial", "locp-newns", + new CheckAvailabilityParameters().withName("sdktest").withLocation("West Europe"), + com.azure.core.util.Context.NONE); } } ``` @@ -418,24 +490,26 @@ public final class NotificationHubsCheckNotificationHubAvailabilitySamples { ### NotificationHubs_CreateOrUpdate ```java -/** Samples for NotificationHubs CreateOrUpdate. */ +import com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties; + +/** + * Samples for NotificationHubs CreateOrUpdate. + */ public final class NotificationHubsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/CreateOrUpdate.json */ /** - * Sample code: NotificationHubCreate. - * + * Sample code: NotificationHubs_CreateOrUpdate. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubCreate( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .define("nh-sdk-hub") - .withRegion("eastus") - .withExistingNamespace("5ktrial", "nh-sdk-ns") - .create(); + public static void + notificationHubsCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().define("nh-sdk-hub").withRegion("eastus") + .withExistingNamespace("5ktrial", "nh-sdk-ns").withProperties(new NotificationHubProperties()).create(); } } ``` @@ -443,36 +517,31 @@ public final class NotificationHubsCreateOrUpdateSamples { ### NotificationHubs_CreateOrUpdateAuthorizationRule ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.models.AccessRights; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties; import java.util.Arrays; -/** Samples for NotificationHubs CreateOrUpdateAuthorizationRule. */ +/** + * Samples for NotificationHubs CreateOrUpdateAuthorizationRule. + */ public final class NotificationHubsCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleCreateOrUpdate.json */ /** - * Sample code: NotificationHubAuthorizationRuleCreate. - * + * Sample code: NotificationHubs_CreateOrUpdateAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleCreate( + public static void notificationHubsCreateOrUpdateAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .createOrUpdateAuthorizationRuleWithResponse( - "5ktrial", - "nh-sdk-ns", - "nh-sdk-hub", - "DefaultListenSharedAccessSignature", - new SharedAccessAuthorizationRuleCreateOrUpdateParameters() - .withProperties( - new SharedAccessAuthorizationRuleProperties() - .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))), - Context.NONE); + manager.notificationHubs().defineAuthorizationRule("MyManageSharedAccessKey") + .withExistingNotificationHub("5ktrial", "nh-sdk-ns", "nh-sdk-hub") + .withProperties(new SharedAccessAuthorizationRuleProperties() + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))) + .create(); } } ``` @@ -480,33 +549,24 @@ public final class NotificationHubsCreateOrUpdateAuthorizationRuleSamples { ### NotificationHubs_DebugSend ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** Samples for NotificationHubs DebugSend. */ +/** + * Samples for NotificationHubs DebugSend. + */ public final class NotificationHubsDebugSendSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/DebugSend.json */ /** - * Sample code: debugsend. - * + * Sample code: NotificationHubs_DebugSend. + * * @param manager Entry point to NotificationHubsManager. */ - public static void debugsend(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) - throws IOException { - manager - .notificationHubs() - .debugSendWithResponse( - "5ktrial", - "nh-sdk-ns", - "nh-sdk-hub", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"data\":{\"message\":\"Hello\"}}", Object.class, SerializerEncoding.JSON), - Context.NONE); + public static void + notificationHubsDebugSend(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().debugSendWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } ``` @@ -514,21 +574,24 @@ public final class NotificationHubsDebugSendSamples { ### NotificationHubs_Delete ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs Delete. */ +/** + * Samples for NotificationHubs Delete. + */ public final class NotificationHubsDeleteSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/Delete.json */ /** - * Sample code: NotificationHubDelete. - * + * Sample code: NotificationHubs_Delete. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubDelete( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().deleteWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + public static void + notificationHubsDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().deleteWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } ``` @@ -536,24 +599,24 @@ public final class NotificationHubsDeleteSamples { ### NotificationHubs_DeleteAuthorizationRule ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs DeleteAuthorizationRule. */ +/** + * Samples for NotificationHubs DeleteAuthorizationRule. + */ public final class NotificationHubsDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleDelete.json */ /** - * Sample code: NotificationHubAuthorizationRuleDelete. - * + * Sample code: NotificationHubs_DeleteAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleDelete( + public static void notificationHubsDeleteAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .deleteAuthorizationRuleWithResponse( - "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", Context.NONE); + manager.notificationHubs().deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + "DefaultListenSharedAccessSignature", com.azure.core.util.Context.NONE); } } ``` @@ -561,20 +624,23 @@ public final class NotificationHubsDeleteAuthorizationRuleSamples { ### NotificationHubs_Get ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs Get. */ +/** + * Samples for NotificationHubs Get. + */ public final class NotificationHubsGetSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/Get.json */ /** - * Sample code: NotificationHubGet. - * + * Sample code: NotificationHubs_Get. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().getWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + public static void notificationHubsGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().getWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } ``` @@ -582,24 +648,24 @@ public final class NotificationHubsGetSamples { ### NotificationHubs_GetAuthorizationRule ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs GetAuthorizationRule. */ +/** + * Samples for NotificationHubs GetAuthorizationRule. + */ public final class NotificationHubsGetAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleGet.json */ /** - * Sample code: NotificationHubAuthorizationRuleGet. - * + * Sample code: NotificationHubs_GetAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleGet( + public static void notificationHubsGetAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .getAuthorizationRuleWithResponse( - "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", Context.NONE); + manager.notificationHubs().getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + "DefaultListenSharedAccessSignature", com.azure.core.util.Context.NONE); } } ``` @@ -607,21 +673,24 @@ public final class NotificationHubsGetAuthorizationRuleSamples { ### NotificationHubs_GetPnsCredentials ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs GetPnsCredentials. */ +/** + * Samples for NotificationHubs GetPnsCredentials. + */ public final class NotificationHubsGetPnsCredentialsSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/PnsCredentialsGet.json */ /** - * Sample code: notificationHubPnsCredentials. - * + * Sample code: NotificationHubs_GetPnsCredentials. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubPnsCredentials( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + public static void + notificationHubsGetPnsCredentials(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } ``` @@ -629,21 +698,23 @@ public final class NotificationHubsGetPnsCredentialsSamples { ### NotificationHubs_List ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs List. */ +/** + * Samples for NotificationHubs List. + */ public final class NotificationHubsListSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/List.json */ /** - * Sample code: NotificationHubListByNameSpace. - * + * Sample code: NotificationHubs_List. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubListByNameSpace( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().list("5ktrial", "nh-sdk-ns", Context.NONE); + public static void + notificationHubsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().list("5ktrial", "nh-sdk-ns", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -651,21 +722,24 @@ public final class NotificationHubsListSamples { ### NotificationHubs_ListAuthorizationRules ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs ListAuthorizationRules. */ +/** + * Samples for NotificationHubs ListAuthorizationRules. + */ public final class NotificationHubsListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleList.json */ /** - * Sample code: NotificationHubAuthorizationRuleListAll. - * + * Sample code: NotificationHubs_ListAuthorizationRules. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleListAll( + public static void notificationHubsListAuthorizationRules( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().listAuthorizationRules("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + manager.notificationHubs().listAuthorizationRules("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } ``` @@ -673,82 +747,88 @@ public final class NotificationHubsListAuthorizationRulesSamples { ### NotificationHubs_ListKeys ```java -import com.azure.core.util.Context; - -/** Samples for NotificationHubs ListKeys. */ +/** + * Samples for NotificationHubs ListKeys. + */ public final class NotificationHubsListKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleListKeys.json */ /** - * Sample code: NotificationHubAuthorizationRuleListKey. - * + * Sample code: NotificationHubs_ListKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleListKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .listKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", "sdk-AuthRules-5800", Context.NONE); + public static void + notificationHubsListKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().listKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", "sdk-AuthRules-5800", + com.azure.core.util.Context.NONE); } } ``` -### NotificationHubs_Patch +### NotificationHubs_RegenerateKeys ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyType; -/** Samples for NotificationHubs Patch. */ -public final class NotificationHubsPatchSamples { +/** + * Samples for NotificationHubs RegenerateKeys. + */ +public final class NotificationHubsRegenerateKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleRegenerateKey.json */ /** - * Sample code: NotificationHubPatch. - * + * Sample code: NotificationHubs_RegenerateKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubPatch( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - NotificationHubResource resource = - manager - .notificationHubs() - .getWithResponse("sdkresourceGroup", "nh-sdk-ns", "sdk-notificationHubs-8708", Context.NONE) - .getValue(); - resource.update().apply(); + public static void + notificationHubsRegenerateKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + "DefaultListenSharedAccessSignature", new PolicyKeyResource().withPolicyKey(PolicyKeyType.PRIMARY_KEY), + com.azure.core.util.Context.NONE); } } ``` -### NotificationHubs_RegenerateKeys +### NotificationHubs_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; +import com.azure.resourcemanager.notificationhubs.models.GcmCredentialProperties; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; -/** Samples for NotificationHubs RegenerateKeys. */ -public final class NotificationHubsRegenerateKeysSamples { +/** + * Samples for NotificationHubs Update. + */ +public final class NotificationHubsUpdateSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/Update.json */ /** - * Sample code: NotificationHubAuthorizationRuleRegenrateKey. - * + * Sample code: NotificationHubs_Update. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleRegenrateKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .regenerateKeysWithResponse( - "5ktrial", - "nh-sdk-ns", - "nh-sdk-hub", - "DefaultListenSharedAccessSignature", - new PolicykeyResource().withPolicyKey("PrimaryKey"), - Context.NONE); + public static void + notificationHubsUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + NotificationHubResource resource = manager.notificationHubs().getWithResponse("sdkresourceGroup", "nh-sdk-ns", + "sdk-notificationHubs-8708", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withProperties(new NotificationHubProperties().withRegistrationTtl("10675199.02:48:05.4775807") + .withGcmCredential(new GcmCredential().withProperties(new GcmCredentialProperties() + .withGcmEndpoint("https://fcm.googleapis.com/fcm/send").withGoogleApiKey("fakeTokenPlaceholder")))) + .apply(); } } ``` @@ -756,20 +836,180 @@ public final class NotificationHubsRegenerateKeysSamples { ### Operations_List ```java -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NHOperationsList.json */ /** - * Sample code: OperationsList. - * + * Sample code: Operations_List. + * * @param manager Entry point to NotificationHubsManager. */ public static void operationsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().delete("5ktrial", "nh-sdk-ns", + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().getWithResponse("5ktrial", "nh-sdk-ns", + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_GetGroupId + +```java +/** + * Samples for PrivateEndpointConnections GetGroupId. + */ +public final class PrivateEndpointConnectionsGetGroupIdSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateLinkResourceGet.json + */ + /** + * Sample code: PrivateEndpointConnections_GetGroupId. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void privateEndpointConnectionsGetGroupId( + com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().getGroupIdWithResponse("5ktrial", "nh-sdk-ns", "namespace", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionList.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().list("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListGroupIds + +```java +/** + * Samples for PrivateEndpointConnections ListGroupIds. + */ +public final class PrivateEndpointConnectionsListGroupIdsSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateLinkResourceList.json + */ + /** + * Sample code: PrivateEndpointConnections_ListGroupIds. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void privateEndpointConnectionsListGroupIds( + com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().listGroupIds("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Update + +```java +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Update. + */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: PrivateEndpointConnections_Update. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().update("5ktrial", "nh-sdk-ns", + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e", + new PrivateEndpointConnectionResourceInner().withProperties(new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new RemotePrivateEndpointConnection()).withPrivateLinkServiceConnectionState( + new RemotePrivateLinkServiceConnectionState().withStatus(PrivateLinkConnectionStatus.APPROVED))), + com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml index d870e55d3370..422c5b3235db 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for NotificationHubs Management - This package contains Microsoft Azure SDK for NotificationHubs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure NotificationHub client. Package tag package-2017-04. + This package contains Microsoft Azure SDK for NotificationHubs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Notification Hubs Resource Provider REST API. Package tag package-preview-2023-10. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/NotificationHubsManager.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/NotificationHubsManager.java index 165323bfae25..be372bc4e2ff 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/NotificationHubsManager.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/NotificationHubsManager.java @@ -10,25 +10,29 @@ 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.notificationhubs.fluent.NotificationHubsManagementClient; +import com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsRPClient; import com.azure.resourcemanager.notificationhubs.implementation.NamespacesImpl; import com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsImpl; -import com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsManagementClientBuilder; +import com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsRPClientBuilder; import com.azure.resourcemanager.notificationhubs.implementation.OperationsImpl; +import com.azure.resourcemanager.notificationhubs.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.notificationhubs.models.Namespaces; import com.azure.resourcemanager.notificationhubs.models.NotificationHubs; import com.azure.resourcemanager.notificationhubs.models.Operations; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnections; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -36,31 +40,32 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to NotificationHubsManager. Azure NotificationHub client. */ +/** + * Entry point to NotificationHubsManager. + * Microsoft Notification Hubs Resource Provider REST API. + */ public final class NotificationHubsManager { - private Operations operations; + private NotificationHubs notificationHubs; private Namespaces namespaces; - private NotificationHubs notificationHubs; + private Operations operations; - private final NotificationHubsManagementClient clientObject; + private PrivateEndpointConnections privateEndpointConnections; + + private final NotificationHubsRPClient clientObject; private NotificationHubsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new NotificationHubsManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new NotificationHubsRPClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); } /** * Creates an instance of NotificationHubs service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the NotificationHubs service API instance. @@ -71,24 +76,40 @@ public static NotificationHubsManager authenticate(TokenCredential credential, A return configure().authenticate(credential, profile); } + /** + * Creates an instance of NotificationHubs service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the NotificationHubs service API instance. + */ + public static NotificationHubsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new NotificationHubsManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create NotificationHubsManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new NotificationHubsManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + 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() { @@ -149,6 +170,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { 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. * @@ -156,9 +190,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -175,21 +211,12 @@ public NotificationHubsManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.notificationhubs") - .append("/") - .append("1.0.0-beta.3"); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.notificationhubs") + .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)"); + 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)"); } @@ -198,49 +225,50 @@ public NotificationHubsManager authenticate(TokenCredential credential, AzurePro scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + 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())); + 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())); + 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(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); return new NotificationHubsManager(httpPipeline, profile, defaultPollInterval); } } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + /** + * Gets the resource collection API of NotificationHubs. It manages NotificationHubResource, + * SharedAccessAuthorizationRuleResource. + * + * @return Resource collection API of NotificationHubs. + */ + public NotificationHubs notificationHubs() { + if (this.notificationHubs == null) { + this.notificationHubs = new NotificationHubsImpl(clientObject.getNotificationHubs(), this); } - return operations; + return notificationHubs; } - /** @return Resource collection API of Namespaces. */ + /** + * Gets the resource collection API of Namespaces. It manages NamespaceResource. + * + * @return Resource collection API of Namespaces. + */ public Namespaces namespaces() { if (this.namespaces == null) { this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); @@ -248,19 +276,38 @@ public Namespaces namespaces() { return namespaces; } - /** @return Resource collection API of NotificationHubs. */ - public NotificationHubs notificationHubs() { - if (this.notificationHubs == null) { - this.notificationHubs = new NotificationHubsImpl(clientObject.getNotificationHubs(), this); + /** + * 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 notificationHubs; + return operations; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; } /** - * @return Wrapped service client NotificationHubsManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client NotificationHubsRPClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client NotificationHubsRPClient. */ - public NotificationHubsManagementClient serviceClient() { + public NotificationHubsRPClient serviceClient() { return this.clientObject; } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NamespacesClient.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NamespacesClient.java index 72ea0544d1c3..2c275f1c4cfd 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NamespacesClient.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NamespacesClient.java @@ -13,371 +13,388 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner; import com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -import com.azure.resourcemanager.notificationhubs.models.NamespaceCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; -/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +/** + * An instance of this class provides access to all the operations defined in NamespacesClient. + */ public interface NamespacesClient { /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. + * + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters); + Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context); /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. - * @param context The context to associate with this operation. + * + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkAvailabilityWithResponse( - CheckAvailabilityParameters parameters, Context context); + CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters); /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - NamespaceResourceInner createOrUpdate( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters); + Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. - * @param context The context to associate with this operation. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, Context context); + NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName); /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NamespaceResourceInner> beginCreateOrUpdate(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters); /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NamespaceResourceInner> beginCreateOrUpdate(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters, Context context); + + /** + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse( - String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, Context context); + NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters, Context context); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters, Context context); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName); + NamespaceResourceInner update(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters); /** * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, Context context); + Response deleteWithResponse(String resourceGroupName, String namespaceName, Context context); /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName); + void delete(String resourceGroupName, String namespaceName); /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Lists all the available namespaces within the subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String skipToken, Integer top, Context context); /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. - * @param context The context to associate with this operation. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context); /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context); /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 name. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName); + SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleResourceInner parameters); /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 name. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return an authorization rule for a namespace by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, Context context); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. + * @return an authorization rule for a namespace by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * - * @param context The context to associate with this operation. + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Namespace operation. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName); /** * Gets the authorization rules for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context); /** - * Gets the authorization rules for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 authorization rules for a namespace. + * @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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. @@ -387,55 +404,64 @@ PagedIterable listAuthorizationRules ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ConnectionStrings to the namespace. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters, Context context); /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceListKeysInner regenerateKeys( - String resourceGroupName, String namespaceName, String authorizationRuleName, PolicykeyResource parameters); + ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + PolicyKeyResource parameters); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 namespace/NotificationHub Connection String. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - PolicykeyResource parameters, + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, Context context); + + /** + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub PNS Credentials. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsClient.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsClient.java index b439c9399d94..f88f06ea4740 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsClient.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsClient.java @@ -16,493 +16,459 @@ import com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -import com.azure.resourcemanager.notificationhubs.models.NotificationHubCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.NotificationHubPatchParameters; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; -/** An instance of this class provides access to all the operations defined in NotificationHubsClient. */ +/** + * An instance of this class provides access to all the operations defined in NotificationHubsClient. + */ public interface NotificationHubsClient { /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckAvailabilityResultInner checkNotificationHubAvailability( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context); /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNotificationHubAvailabilityWithResponse( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, Context context); + CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters); /** - * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the notification hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); + + /** + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - NotificationHubResourceInner createOrUpdate( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters); + NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName); /** * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubResourceInner parameters, Context context); /** - * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - NotificationHubResourceInner patch(String resourceGroupName, String namespaceName, String notificationHubName); + NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubResourceInner parameters); /** * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to patch a NotificationHub Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubPatchParameters parameters, - Context context); + Response updateWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubPatchParameters parameters, Context context); /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification Hub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String notificationHubName); + NotificationHubResourceInner update(String resourceGroupName, String namespaceName, String notificationHubName, + NotificationHubPatchParameters parameters); /** * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + Response deleteWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, + Context context); /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - NotificationHubResourceInner get(String resourceGroupName, String namespaceName, String notificationHubName); + void delete(String resourceGroupName, String namespaceName, String notificationHubName); /** * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, String skipToken, + Integer top, Context context); /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Debug send parameters. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return description of a NotificationHub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response debugSendWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Object parameters, Context context); + Response debugSendWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters); + DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName); /** * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 AuthorizationRules. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context); + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context); /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters); /** * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context); /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName); /** * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. + * @return an authorization rule for a NotificationHub by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context); - - /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @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 response of the List NotificationHub operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName); + Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, Context context); /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 response of the List NotificationHub operation. + * @return an authorization rule for a NotificationHub by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName); /** * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName); /** * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName, Context context); /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceListKeysInner listKeys( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context); /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context); + ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName); /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceListKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context); /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context); + ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName, PolicyKeyResource parameters); /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub PNS Credentials. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PnsCredentialsResourceInner getPnsCredentials( - String resourceGroupName, String namespaceName, String notificationHubName); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param context The context to associate with this operation. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return description of a NotificationHub PNS Credentials. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getPnsCredentialsWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsManagementClient.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsRPClient.java similarity index 74% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsManagementClient.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsRPClient.java index 29ade8278fa8..776096c9a446 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsManagementClient.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsRPClient.java @@ -7,62 +7,70 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for NotificationHubsManagementClient class. */ -public interface NotificationHubsManagementClient { +/** + * The interface for NotificationHubsRPClient class. + */ +public interface NotificationHubsRPClient { /** - * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * + * Gets The ID of the target subscription. The value must be an UUID. + * * @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 OperationsClient object to access its operations. - * - * @return the OperationsClient object. + * Gets the NotificationHubsClient object to access its operations. + * + * @return the NotificationHubsClient object. */ - OperationsClient getOperations(); + NotificationHubsClient getNotificationHubs(); /** * Gets the NamespacesClient object to access its operations. - * + * * @return the NamespacesClient object. */ NamespacesClient getNamespaces(); /** - * Gets the NotificationHubsClient object to access its operations. - * - * @return the NotificationHubsClient object. + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. */ - NotificationHubsClient getNotificationHubs(); + OperationsClient getOperations(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/OperationsClient.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/OperationsClient.java index 321a39a96140..a15807903b07 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/OperationsClient.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/OperationsClient.java @@ -10,26 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/PrivateEndpointConnectionsClient.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..dbc6f4cd30a9 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.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.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a + * sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionResourceInner> beginUpdate( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters); + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a + * sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionResourceInner> beginUpdate( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, Context context); + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters); + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context); + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context); + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName); + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, + Context context); + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "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 a Private Link Arm Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGroupIdWithResponse(String resourceGroupName, String namespaceName, + String subResourceName, Context context); + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Private Link Arm Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner getGroupId(String resourceGroupName, String namespaceName, String subResourceName); + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGroupIds(String resourceGroupName, String namespaceName); + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGroupIds(String resourceGroupName, String namespaceName, + Context context); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ApnsCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ApnsCredentialProperties.java deleted file mode 100644 index 323255b06eac..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ApnsCredentialProperties.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Description of a NotificationHub ApnsCredential. Note that there is no explicit switch between Certificate and Token - * Authentication Modes. The mode is determined based on the properties passed in. - */ -@Fluent -public final class ApnsCredentialProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApnsCredentialProperties.class); - - /* - * The APNS certificate. Specify if using Certificate Authentication Mode. - */ - @JsonProperty(value = "apnsCertificate") - private String apnsCertificate; - - /* - * The APNS certificate password if it exists. - */ - @JsonProperty(value = "certificateKey") - private String certificateKey; - - /* - * The APNS endpoint of this credential. If using Certificate - * Authentication Mode and Sandbox specify - * 'gateway.sandbox.push.apple.com'. If using Certificate Authentication - * Mode and Production specify 'gateway.push.apple.com'. If using Token - * Authentication Mode and Sandbox specify - * 'https://api.development.push.apple.com:443/3/device'. If using Token - * Authentication Mode and Production specify - * 'https://api.push.apple.com:443/3/device'. - */ - @JsonProperty(value = "endpoint") - private String endpoint; - - /* - * The APNS certificate thumbprint. Specify if using Certificate - * Authentication Mode. - */ - @JsonProperty(value = "thumbprint") - private String thumbprint; - - /* - * A 10-character key identifier (kid) key, obtained from your developer - * account. Specify if using Token Authentication Mode. - */ - @JsonProperty(value = "keyId") - private String keyId; - - /* - * The name of the application or BundleId. Specify if using Token - * Authentication Mode. - */ - @JsonProperty(value = "appName") - private String appName; - - /* - * The issuer (iss) registered claim key. The value is a 10-character - * TeamId, obtained from your developer account. Specify if using Token - * Authentication Mode. - */ - @JsonProperty(value = "appId") - private String appId; - - /* - * Provider Authentication Token, obtained through your developer account. - * Specify if using Token Authentication Mode. - */ - @JsonProperty(value = "token") - private String token; - - /** - * Get the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. - * - * @return the apnsCertificate value. - */ - public String apnsCertificate() { - return this.apnsCertificate; - } - - /** - * Set the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. - * - * @param apnsCertificate the apnsCertificate value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withApnsCertificate(String apnsCertificate) { - this.apnsCertificate = apnsCertificate; - return this; - } - - /** - * Get the certificateKey property: The APNS certificate password if it exists. - * - * @return the certificateKey value. - */ - public String certificateKey() { - return this.certificateKey; - } - - /** - * Set the certificateKey property: The APNS certificate password if it exists. - * - * @param certificateKey the certificateKey value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withCertificateKey(String certificateKey) { - this.certificateKey = certificateKey; - return this; - } - - /** - * Get the endpoint property: The APNS endpoint of this credential. If using Certificate Authentication Mode and - * Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify - * 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify - * 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify - * 'https://api.push.apple.com:443/3/device'. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.endpoint; - } - - /** - * Set the endpoint property: The APNS endpoint of this credential. If using Certificate Authentication Mode and - * Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify - * 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify - * 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify - * 'https://api.push.apple.com:443/3/device'. - * - * @param endpoint the endpoint value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withEndpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /** - * Get the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Set the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. - * - * @param thumbprint the thumbprint value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - return this; - } - - /** - * Get the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. - * - * @return the keyId value. - */ - public String keyId() { - return this.keyId; - } - - /** - * Set the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. - * - * @param keyId the keyId value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withKeyId(String keyId) { - this.keyId = keyId; - return this; - } - - /** - * Get the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. - * - * @return the appName value. - */ - public String appName() { - return this.appName; - } - - /** - * Set the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. - * - * @param appName the appName value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withAppName(String appName) { - this.appName = appName; - return this; - } - - /** - * Get the appId property: The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from - * your developer account. Specify if using Token Authentication Mode. - * - * @return the appId value. - */ - public String appId() { - return this.appId; - } - - /** - * Set the appId property: The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from - * your developer account. Specify if using Token Authentication Mode. - * - * @param appId the appId value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withAppId(String appId) { - this.appId = appId; - return this; - } - - /** - * Get the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Set the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. - * - * @param token the token value to set. - * @return the ApnsCredentialProperties object itself. - */ - public ApnsCredentialProperties withToken(String token) { - this.token = token; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/CheckAvailabilityResultInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/CheckAvailabilityResultInner.java index 01a9fc91faaf..a3839b8f6b9f 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/CheckAvailabilityResultInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/CheckAvailabilityResultInner.java @@ -5,35 +5,60 @@ package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Description of a CheckAvailability resource. */ +/** + * Description of a CheckAvailability resource. + */ @Fluent -public final class CheckAvailabilityResultInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckAvailabilityResultInner.class); - +public final class CheckAvailabilityResultInner extends ProxyResource { /* - * True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. + * Gets or sets true if the name is available and can be used to + * create new Namespace/NotificationHub. Otherwise false. */ @JsonProperty(value = "isAvailiable") private Boolean isAvailiable; /* - * The sku of the created namespace + * Deprecated - only for compatibility. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Deprecated - only for compatibility. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The Sku description for a namespace */ @JsonProperty(value = "sku") private Sku sku; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of CheckAvailabilityResultInner class. + */ + public CheckAvailabilityResultInner() { + } + /** - * Get the isAvailiable property: True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. - * + * Get the isAvailiable property: Gets or sets true if the name is available and can be used to + * create new Namespace/NotificationHub. Otherwise false. + * * @return the isAvailiable value. */ public Boolean isAvailiable() { @@ -41,9 +66,9 @@ public Boolean isAvailiable() { } /** - * Set the isAvailiable property: True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. - * + * Set the isAvailiable property: Gets or sets true if the name is available and can be used to + * create new Namespace/NotificationHub. Otherwise false. + * * @param isAvailiable the isAvailiable value to set. * @return the CheckAvailabilityResultInner object itself. */ @@ -53,8 +78,48 @@ public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { } /** - * Get the sku property: The sku of the created namespace. - * + * Get the location property: Deprecated - only for compatibility. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Deprecated - only for compatibility. + * + * @param location the location value to set. + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Deprecated - only for compatibility. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Deprecated - only for compatibility. + * + * @param tags the tags value to set. + * @return the CheckAvailabilityResultInner object itself. + */ + public CheckAvailabilityResultInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The Sku description for a namespace. + * * @return the sku value. */ public Sku sku() { @@ -62,8 +127,8 @@ public Sku sku() { } /** - * Set the sku property: The sku of the created namespace. - * + * Set the sku property: The Sku description for a namespace. + * * @param sku the sku value to set. * @return the CheckAvailabilityResultInner object itself. */ @@ -72,23 +137,18 @@ public CheckAvailabilityResultInner withSku(Sku sku) { return this; } - /** {@inheritDoc} */ - @Override - public CheckAvailabilityResultInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public CheckAvailabilityResultInner withTags(Map tags) { - super.withTags(tags); - return this; + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResponseInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResponseInner.java index 891d9bb7e8d8..344651d70ee2 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResponseInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResponseInner.java @@ -5,153 +5,126 @@ package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.models.DebugSendResult; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Description of a NotificationHub Resource. */ +/** + * Description of a NotificationHub Resource. + */ @Fluent -public final class DebugSendResponseInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DebugSendResponseInner.class); - +public final class DebugSendResponseInner extends ProxyResource { /* - * Properties of the NotificationHub. + * Result of DebugSend operations. */ @JsonProperty(value = "properties") - private DebugSendResult innerProperties; + private DebugSendResult properties; /* - * The sku of the created namespace + * Deprecated - only for compatibility. */ - @JsonProperty(value = "sku") - private Sku sku; + @JsonProperty(value = "location") + private String location; - /** - * Get the innerProperties property: Properties of the NotificationHub. - * - * @return the innerProperties value. + /* + * Deprecated - only for compatibility. */ - private DebugSendResult innerProperties() { - return this.innerProperties; - } + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public Sku sku() { - return this.sku; - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the DebugSendResponseInner object itself. + * Creates an instance of DebugSendResponseInner class. */ - public DebugSendResponseInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public DebugSendResponseInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DebugSendResponseInner withTags(Map tags) { - super.withTags(tags); - return this; + public DebugSendResponseInner() { } /** - * Get the success property: successful send. - * - * @return the success value. + * Get the properties property: Result of DebugSend operations. + * + * @return the properties value. */ - public Float success() { - return this.innerProperties() == null ? null : this.innerProperties().success(); + public DebugSendResult properties() { + return this.properties; } /** - * Set the success property: successful send. - * - * @param success the success value to set. + * Set the properties property: Result of DebugSend operations. + * + * @param properties the properties value to set. * @return the DebugSendResponseInner object itself. */ - public DebugSendResponseInner withSuccess(Float success) { - if (this.innerProperties() == null) { - this.innerProperties = new DebugSendResult(); - } - this.innerProperties().withSuccess(success); + public DebugSendResponseInner withProperties(DebugSendResult properties) { + this.properties = properties; return this; } /** - * Get the failure property: send failure. - * - * @return the failure value. + * Get the location property: Deprecated - only for compatibility. + * + * @return the location value. */ - public Float failure() { - return this.innerProperties() == null ? null : this.innerProperties().failure(); + public String location() { + return this.location; } /** - * Set the failure property: send failure. - * - * @param failure the failure value to set. + * Set the location property: Deprecated - only for compatibility. + * + * @param location the location value to set. * @return the DebugSendResponseInner object itself. */ - public DebugSendResponseInner withFailure(Float failure) { - if (this.innerProperties() == null) { - this.innerProperties = new DebugSendResult(); - } - this.innerProperties().withFailure(failure); + public DebugSendResponseInner withLocation(String location) { + this.location = location; return this; } /** - * Get the results property: actual failure description. - * - * @return the results value. + * Get the tags property: Deprecated - only for compatibility. + * + * @return the tags value. */ - public Object results() { - return this.innerProperties() == null ? null : this.innerProperties().results(); + public Map tags() { + return this.tags; } /** - * Set the results property: actual failure description. - * - * @param results the results value to set. + * Set the tags property: Deprecated - only for compatibility. + * + * @param tags the tags value to set. * @return the DebugSendResponseInner object itself. */ - public DebugSendResponseInner withResults(Object results) { - if (this.innerProperties() == null) { - this.innerProperties = new DebugSendResult(); - } - this.innerProperties().withResults(results); + public DebugSendResponseInner withTags(Map tags) { + this.tags = tags; return this; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResult.java deleted file mode 100644 index a9c882cb31d9..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResult.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DebugSendResult model. */ -@Fluent -public final class DebugSendResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DebugSendResult.class); - - /* - * successful send - */ - @JsonProperty(value = "success") - private Float success; - - /* - * send failure - */ - @JsonProperty(value = "failure") - private Float failure; - - /* - * actual failure description - */ - @JsonProperty(value = "results") - private Object results; - - /** - * Get the success property: successful send. - * - * @return the success value. - */ - public Float success() { - return this.success; - } - - /** - * Set the success property: successful send. - * - * @param success the success value to set. - * @return the DebugSendResult object itself. - */ - public DebugSendResult withSuccess(Float success) { - this.success = success; - return this; - } - - /** - * Get the failure property: send failure. - * - * @return the failure value. - */ - public Float failure() { - return this.failure; - } - - /** - * Set the failure property: send failure. - * - * @param failure the failure value to set. - * @return the DebugSendResult object itself. - */ - public DebugSendResult withFailure(Float failure) { - this.failure = failure; - return this; - } - - /** - * Get the results property: actual failure description. - * - * @return the results value. - */ - public Object results() { - return this.results; - } - - /** - * Set the results property: actual failure description. - * - * @param results the results value to set. - * @return the DebugSendResult object itself. - */ - public DebugSendResult withResults(Object results) { - this.results = results; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceProperties.java deleted file mode 100644 index 98bb7a513216..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceProperties.java +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Namespace properties. */ -@Fluent -public final class NamespaceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespaceProperties.class); - - /* - * The name of the namespace. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Provisioning state of the Namespace. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * Specifies the targeted region in which the namespace should be created. - * It can be any of the following values: Australia East, Australia - * Southeast, Central US, East US, East US 2, West US, North Central US, - * South Central US, East Asia, Southeast Asia, Brazil South, Japan East, - * Japan West, North Europe, West Europe - */ - @JsonProperty(value = "region") - private String region; - - /* - * Identifier for Azure Insights metrics - */ - @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) - private String metricId; - - /* - * Status of the namespace. It can be any of these values:1 = - * Created/Active2 = Creating3 = Suspended4 = Deleting - */ - @JsonProperty(value = "status") - private String status; - - /* - * The time the namespace was created. - */ - @JsonProperty(value = "createdAt") - private OffsetDateTime createdAt; - - /* - * The time the namespace was updated. - */ - @JsonProperty(value = "updatedAt") - private OffsetDateTime updatedAt; - - /* - * Endpoint you can use to perform NotificationHub operations. - */ - @JsonProperty(value = "serviceBusEndpoint") - private String serviceBusEndpoint; - - /* - * The Id of the Azure subscription associated with the namespace. - */ - @JsonProperty(value = "subscriptionId") - private String subscriptionId; - - /* - * ScaleUnit where the namespace gets created - */ - @JsonProperty(value = "scaleUnit") - private String scaleUnit; - - /* - * Whether or not the namespace is currently enabled. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Whether or not the namespace is set as Critical. - */ - @JsonProperty(value = "critical") - private Boolean critical; - - /* - * Data center for the namespace - */ - @JsonProperty(value = "dataCenter") - private String dataCenter; - - /* - * The namespace type. - */ - @JsonProperty(value = "namespaceType") - private NamespaceType namespaceType; - - /** - * Get the name property: The name of the namespace. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the namespace. - * - * @param name the name value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Namespace. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the Namespace. - * - * @param provisioningState the provisioningState value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the region property: Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central - * US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central - * US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe. - * - * @param region the region value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withRegion(String region) { - this.region = region; - return this; - } - - /** - * Get the metricId property: Identifier for Azure Insights metrics. - * - * @return the metricId value. - */ - public String metricId() { - return this.metricId; - } - - /** - * Get the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * - * @param status the status value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the createdAt property: The time the namespace was created. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The time the namespace was created. - * - * @param createdAt the createdAt value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the updatedAt property: The time the namespace was updated. - * - * @return the updatedAt value. - */ - public OffsetDateTime updatedAt() { - return this.updatedAt; - } - - /** - * Set the updatedAt property: The time the namespace was updated. - * - * @param updatedAt the updatedAt value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. - * - * @return the serviceBusEndpoint value. - */ - public String serviceBusEndpoint() { - return this.serviceBusEndpoint; - } - - /** - * Set the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. - * - * @param serviceBusEndpoint the serviceBusEndpoint value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withServiceBusEndpoint(String serviceBusEndpoint) { - this.serviceBusEndpoint = serviceBusEndpoint; - return this; - } - - /** - * Get the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @param subscriptionId the subscriptionId value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @return the scaleUnit value. - */ - public String scaleUnit() { - return this.scaleUnit; - } - - /** - * Set the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @param scaleUnit the scaleUnit value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withScaleUnit(String scaleUnit) { - this.scaleUnit = scaleUnit; - return this; - } - - /** - * Get the enabled property: Whether or not the namespace is currently enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Whether or not the namespace is currently enabled. - * - * @param enabled the enabled value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the critical property: Whether or not the namespace is set as Critical. - * - * @return the critical value. - */ - public Boolean critical() { - return this.critical; - } - - /** - * Set the critical property: Whether or not the namespace is set as Critical. - * - * @param critical the critical value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withCritical(Boolean critical) { - this.critical = critical; - return this; - } - - /** - * Get the dataCenter property: Data center for the namespace. - * - * @return the dataCenter value. - */ - public String dataCenter() { - return this.dataCenter; - } - - /** - * Set the dataCenter property: Data center for the namespace. - * - * @param dataCenter the dataCenter value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withDataCenter(String dataCenter) { - this.dataCenter = dataCenter; - return this; - } - - /** - * Get the namespaceType property: The namespace type. - * - * @return the namespaceType value. - */ - public NamespaceType namespaceType() { - return this.namespaceType; - } - - /** - * Set the namespaceType property: The namespace type. - * - * @param namespaceType the namespaceType value to set. - * @return the NamespaceProperties object itself. - */ - public NamespaceProperties withNamespaceType(NamespaceType namespaceType) { - this.namespaceType = namespaceType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceResourceInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceResourceInner.java index 74cb45a017ad..ba7debb2de40 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceResourceInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceResourceInner.java @@ -6,43 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; +import com.azure.resourcemanager.notificationhubs.models.NamespaceProperties; import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; import java.util.Map; -/** Description of a Namespace resource. */ +/** + * Notification Hubs Namespace Resource. + */ @Fluent public final class NamespaceResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespaceResourceInner.class); + /* + * The Sku description for a namespace + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; /* - * Properties of the Namespace. + * Represents namespace properties. */ @JsonProperty(value = "properties") - private NamespaceProperties innerProperties; + private NamespaceProperties properties; /* - * The sku of the created namespace + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "sku") - private Sku sku; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the innerProperties property: Properties of the Namespace. - * - * @return the innerProperties value. + * Creates an instance of NamespaceResourceInner class. */ - private NamespaceProperties innerProperties() { - return this.innerProperties; + public NamespaceResourceInner() { } /** - * Get the sku property: The sku of the created namespace. - * + * Get the sku property: The Sku description for a namespace. + * * @return the sku value. */ public Sku sku() { @@ -50,8 +52,8 @@ public Sku sku() { } /** - * Set the sku property: The sku of the created namespace. - * + * Set the sku property: The Sku description for a namespace. + * * @param sku the sku value to set. * @return the NamespaceResourceInner object itself. */ @@ -60,345 +62,69 @@ public NamespaceResourceInner withSku(Sku sku) { return this; } - /** {@inheritDoc} */ - @Override - public NamespaceResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NamespaceResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the name property: The name of the namespace. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: The name of the namespace. - * - * @param name the name value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withName(name); - 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(); - } - - /** - * Set the provisioningState property: Provisioning state of the Namespace. - * - * @param provisioningState the provisioningState value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the region property: Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central - * US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe. - * - * @return the region value. - */ - public String region() { - return this.innerProperties() == null ? null : this.innerProperties().region(); - } - - /** - * Set the region property: Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central - * US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe. - * - * @param region the region value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withRegion(String region) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withRegion(region); - return this; - } - - /** - * Get the metricId property: Identifier for Azure Insights metrics. - * - * @return the metricId value. - */ - public String metricId() { - return this.innerProperties() == null ? null : this.innerProperties().metricId(); - } - - /** - * Get the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * - * @param status the status value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withStatus(String status) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * 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(); - } - - /** - * Set the createdAt property: The time the namespace was created. - * - * @param createdAt the createdAt value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withCreatedAt(OffsetDateTime createdAt) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withCreatedAt(createdAt); - return this; - } - - /** - * 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(); - } - - /** - * Set the updatedAt property: The time the namespace was updated. - * - * @param updatedAt the updatedAt value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withUpdatedAt(OffsetDateTime updatedAt) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withUpdatedAt(updatedAt); - return this; - } - - /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. - * - * @return the serviceBusEndpoint value. - */ - public String serviceBusEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); - } - - /** - * Set the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. - * - * @param serviceBusEndpoint the serviceBusEndpoint value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withServiceBusEndpoint(String serviceBusEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withServiceBusEndpoint(serviceBusEndpoint); - return this; - } - - /** - * Get the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Set the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @param subscriptionId the subscriptionId value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withSubscriptionId(String subscriptionId) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withSubscriptionId(subscriptionId); - return this; - } - - /** - * Get the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @return the scaleUnit value. - */ - public String scaleUnit() { - return this.innerProperties() == null ? null : this.innerProperties().scaleUnit(); - } - - /** - * Set the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @param scaleUnit the scaleUnit value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withScaleUnit(String scaleUnit) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withScaleUnit(scaleUnit); - return this; - } - /** - * Get the enabled property: Whether or not the namespace is currently enabled. - * - * @return the enabled value. + * Get the properties property: Represents namespace properties. + * + * @return the properties value. */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); + public NamespaceProperties properties() { + return this.properties; } /** - * Set the enabled property: Whether or not the namespace is currently enabled. - * - * @param enabled the enabled value to set. + * Set the properties property: Represents namespace properties. + * + * @param properties the properties value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withEnabled(enabled); + public NamespaceResourceInner withProperties(NamespaceProperties properties) { + this.properties = properties; return this; } /** - * Get the critical property: Whether or not the namespace is set as Critical. - * - * @return the critical value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public Boolean critical() { - return this.innerProperties() == null ? null : this.innerProperties().critical(); + public SystemData systemData() { + return this.systemData; } /** - * Set the critical property: Whether or not the namespace is set as Critical. - * - * @param critical the critical value to set. - * @return the NamespaceResourceInner object itself. + * {@inheritDoc} */ - public NamespaceResourceInner withCritical(Boolean critical) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withCritical(critical); - return this; - } - - /** - * Get the dataCenter property: Data center for the namespace. - * - * @return the dataCenter value. - */ - public String dataCenter() { - return this.innerProperties() == null ? null : this.innerProperties().dataCenter(); - } - - /** - * Set the dataCenter property: Data center for the namespace. - * - * @param dataCenter the dataCenter value to set. - * @return the NamespaceResourceInner object itself. - */ - public NamespaceResourceInner withDataCenter(String dataCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withDataCenter(dataCenter); + @Override + public NamespaceResourceInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the namespaceType property: The namespace type. - * - * @return the namespaceType value. - */ - public NamespaceType namespaceType() { - return this.innerProperties() == null ? null : this.innerProperties().namespaceType(); - } - - /** - * Set the namespaceType property: The namespace type. - * - * @param namespaceType the namespaceType value to set. - * @return the NamespaceResourceInner object itself. + * {@inheritDoc} */ - public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withNamespaceType(namespaceType); + @Override + public NamespaceResourceInner withTags(Map tags) { + super.withTags(tags); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { + if (sku() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model NamespaceResourceInner")); + } else { sku().validate(); } + if (properties() != null) { + properties().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(NamespaceResourceInner.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubResourceInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubResourceInner.java index c449525c9cb6..733dbd407b9c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubResourceInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubResourceInner.java @@ -6,295 +6,116 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.AdmCredential; -import com.azure.resourcemanager.notificationhubs.models.ApnsCredential; -import com.azure.resourcemanager.notificationhubs.models.BaiduCredential; -import com.azure.resourcemanager.notificationhubs.models.GcmCredential; -import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties; import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.WnsCredential; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; import java.util.Map; -/** Description of a NotificationHub Resource. */ +/** + * Notification Hub Resource. + */ @Fluent public final class NotificationHubResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubResourceInner.class); - /* - * Properties of the NotificationHub. + * NotificationHub properties. */ @JsonProperty(value = "properties") - private NotificationHubProperties innerProperties; + private NotificationHubProperties properties; /* - * The sku of the created namespace + * The Sku description for a namespace */ @JsonProperty(value = "sku") private Sku sku; - /** - * Get the innerProperties property: Properties of the NotificationHub. - * - * @return the innerProperties value. - */ - private NotificationHubProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the NotificationHubResourceInner object itself. - */ - public NotificationHubResourceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationHubResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationHubResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the name property: The NotificationHub name. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: The NotificationHub name. - * - * @param name the name value to set. - * @return the NotificationHubResourceInner object itself. - */ - public NotificationHubResourceInner withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withName(name); - return this; - } - - /** - * Get the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @return the registrationTtl value. - */ - public String registrationTtl() { - return this.innerProperties() == null ? null : this.innerProperties().registrationTtl(); - } - - /** - * Set the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @param registrationTtl the registrationTtl value to set. - * @return the NotificationHubResourceInner object itself. - */ - public NotificationHubResourceInner withRegistrationTtl(String registrationTtl) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withRegistrationTtl(registrationTtl); - return this; - } - - /** - * Get the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @return the authorizationRules value. - */ - public List authorizationRules() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationRules(); - } - - /** - * Set the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @param authorizationRules the authorizationRules value to set. - * @return the NotificationHubResourceInner object itself. - */ - public NotificationHubResourceInner withAuthorizationRules( - List authorizationRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withAuthorizationRules(authorizationRules); - return this; - } - - /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. - */ - public ApnsCredential apnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().apnsCredential(); - } - - /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential the apnsCredential value to set. - * @return the NotificationHubResourceInner object itself. - */ - public NotificationHubResourceInner withApnsCredential(ApnsCredential apnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withApnsCredential(apnsCredential); - return this; - } - - /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public WnsCredential wnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().wnsCredential(); - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential the wnsCredential value to set. - * @return the NotificationHubResourceInner object itself. + * Creates an instance of NotificationHubResourceInner class. */ - public NotificationHubResourceInner withWnsCredential(WnsCredential wnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withWnsCredential(wnsCredential); - return this; + public NotificationHubResourceInner() { } /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. + * Get the properties property: NotificationHub properties. + * + * @return the properties value. */ - public GcmCredential gcmCredential() { - return this.innerProperties() == null ? null : this.innerProperties().gcmCredential(); + public NotificationHubProperties properties() { + return this.properties; } /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential the gcmCredential value to set. + * Set the properties property: NotificationHub properties. + * + * @param properties the properties value to set. * @return the NotificationHubResourceInner object itself. */ - public NotificationHubResourceInner withGcmCredential(GcmCredential gcmCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withGcmCredential(gcmCredential); + public NotificationHubResourceInner withProperties(NotificationHubProperties properties) { + this.properties = properties; return this; } /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. + * Get the sku property: The Sku description for a namespace. + * + * @return the sku value. */ - public MpnsCredential mpnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().mpnsCredential(); + public Sku sku() { + return this.sku; } /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential the mpnsCredential value to set. + * Set the sku property: The Sku description for a namespace. + * + * @param sku the sku value to set. * @return the NotificationHubResourceInner object itself. */ - public NotificationHubResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withMpnsCredential(mpnsCredential); + public NotificationHubResourceInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public AdmCredential admCredential() { - return this.innerProperties() == null ? null : this.innerProperties().admCredential(); + public SystemData systemData() { + return this.systemData; } /** - * Set the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential the admCredential value to set. - * @return the NotificationHubResourceInner object itself. + * {@inheritDoc} */ - public NotificationHubResourceInner withAdmCredential(AdmCredential admCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withAdmCredential(admCredential); + @Override + public NotificationHubResourceInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. + * {@inheritDoc} */ - public BaiduCredential baiduCredential() { - return this.innerProperties() == null ? null : this.innerProperties().baiduCredential(); - } - - /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential the baiduCredential value to set. - * @return the NotificationHubResourceInner object itself. - */ - public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withBaiduCredential(baiduCredential); + @Override + public NotificationHubResourceInner withTags(Map tags) { + super.withTags(tags); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (sku() != null) { sku().validate(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/OperationInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/OperationInner.java index 9a6e47c1903a..c86dca6fafca 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/OperationInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/OperationInner.java @@ -5,18 +5,17 @@ package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.notificationhubs.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.notificationhubs.models.OperationProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** A NotificationHubs REST API operation. */ +/** + * A NotificationHubs REST API operation. + */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* - * Operation name: {provider}/{resource}/{operation} + * Gets operation name: {provider}/{resource}/{operation} */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; @@ -27,9 +26,27 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; + /* + * Optional operation properties. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /* + * Gets or sets IsDataAction property. It is used to differentiate management and data plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: Gets operation name: {provider}/{resource}/{operation}. + * * @return the name value. */ public String name() { @@ -38,7 +55,7 @@ public String name() { /** * Get the display property: The object that represents the operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -47,7 +64,7 @@ public OperationDisplay display() { /** * Set the display property: The object that represents the operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -56,14 +73,47 @@ public OperationInner withDisplay(OperationDisplay display) { return this; } + /** + * Get the properties property: Optional operation properties. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Optional operation properties. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the isDataAction property: Gets or sets IsDataAction property. It is used to differentiate management and + * data plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (display() != null) { display().validate(); } + if (properties() != null) { + properties().validate(); + } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsProperties.java deleted file mode 100644 index a23d279302cc..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsProperties.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.AdmCredential; -import com.azure.resourcemanager.notificationhubs.models.ApnsCredential; -import com.azure.resourcemanager.notificationhubs.models.BaiduCredential; -import com.azure.resourcemanager.notificationhubs.models.GcmCredential; -import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; -import com.azure.resourcemanager.notificationhubs.models.WnsCredential; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of a NotificationHub PNS Credentials. */ -@Fluent -public final class PnsCredentialsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PnsCredentialsProperties.class); - - /* - * The ApnsCredential of the created NotificationHub - */ - @JsonProperty(value = "apnsCredential") - private ApnsCredential apnsCredential; - - /* - * The WnsCredential of the created NotificationHub - */ - @JsonProperty(value = "wnsCredential") - private WnsCredential wnsCredential; - - /* - * The GcmCredential of the created NotificationHub - */ - @JsonProperty(value = "gcmCredential") - private GcmCredential gcmCredential; - - /* - * The MpnsCredential of the created NotificationHub - */ - @JsonProperty(value = "mpnsCredential") - private MpnsCredential mpnsCredential; - - /* - * The AdmCredential of the created NotificationHub - */ - @JsonProperty(value = "admCredential") - private AdmCredential admCredential; - - /* - * The BaiduCredential of the created NotificationHub - */ - @JsonProperty(value = "baiduCredential") - private BaiduCredential baiduCredential; - - /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. - */ - public ApnsCredential apnsCredential() { - return this.apnsCredential; - } - - /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential the apnsCredential value to set. - * @return the PnsCredentialsProperties object itself. - */ - public PnsCredentialsProperties withApnsCredential(ApnsCredential apnsCredential) { - this.apnsCredential = apnsCredential; - return this; - } - - /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. - */ - public WnsCredential wnsCredential() { - return this.wnsCredential; - } - - /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential the wnsCredential value to set. - * @return the PnsCredentialsProperties object itself. - */ - public PnsCredentialsProperties withWnsCredential(WnsCredential wnsCredential) { - this.wnsCredential = wnsCredential; - return this; - } - - /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. - */ - public GcmCredential gcmCredential() { - return this.gcmCredential; - } - - /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential the gcmCredential value to set. - * @return the PnsCredentialsProperties object itself. - */ - public PnsCredentialsProperties withGcmCredential(GcmCredential gcmCredential) { - this.gcmCredential = gcmCredential; - return this; - } - - /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. - */ - public MpnsCredential mpnsCredential() { - return this.mpnsCredential; - } - - /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential the mpnsCredential value to set. - * @return the PnsCredentialsProperties object itself. - */ - public PnsCredentialsProperties withMpnsCredential(MpnsCredential mpnsCredential) { - this.mpnsCredential = mpnsCredential; - return this; - } - - /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. - */ - public AdmCredential admCredential() { - return this.admCredential; - } - - /** - * Set the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential the admCredential value to set. - * @return the PnsCredentialsProperties object itself. - */ - public PnsCredentialsProperties withAdmCredential(AdmCredential admCredential) { - this.admCredential = admCredential; - return this; - } - - /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. - */ - public BaiduCredential baiduCredential() { - return this.baiduCredential; - } - - /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential the baiduCredential value to set. - * @return the PnsCredentialsProperties object itself. - */ - public PnsCredentialsProperties withBaiduCredential(BaiduCredential baiduCredential) { - this.baiduCredential = baiduCredential; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (apnsCredential() != null) { - apnsCredential().validate(); - } - if (wnsCredential() != null) { - wnsCredential().validate(); - } - if (gcmCredential() != null) { - gcmCredential().validate(); - } - if (mpnsCredential() != null) { - mpnsCredential().validate(); - } - if (admCredential() != null) { - admCredential().validate(); - } - if (baiduCredential() != null) { - baiduCredential().validate(); - } - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsResourceInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsResourceInner.java index 9aff52334465..fe86bb86741d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsResourceInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsResourceInner.java @@ -5,228 +5,128 @@ package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.AdmCredential; -import com.azure.resourcemanager.notificationhubs.models.ApnsCredential; -import com.azure.resourcemanager.notificationhubs.models.BaiduCredential; -import com.azure.resourcemanager.notificationhubs.models.GcmCredential; -import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.WnsCredential; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentials; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Description of a NotificationHub PNS Credentials. */ +/** + * Description of a NotificationHub PNS Credentials. This is a response of the POST requests that return namespace or + * hubs + * PNS credentials. + */ @Fluent -public final class PnsCredentialsResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PnsCredentialsResourceInner.class); - +public final class PnsCredentialsResourceInner extends ProxyResource { /* - * NotificationHub PNS Credentials. + * Collection of Notification Hub or Notification Hub Namespace PNS credentials. */ @JsonProperty(value = "properties") - private PnsCredentialsProperties innerProperties; + private PnsCredentials properties; /* - * The sku of the created namespace - */ - @JsonProperty(value = "sku") - private Sku sku; - - /** - * Get the innerProperties property: NotificationHub PNS Credentials. - * - * @return the innerProperties value. - */ - private PnsCredentialsProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the PnsCredentialsResourceInner object itself. - */ - public PnsCredentialsResourceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public PnsCredentialsResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PnsCredentialsResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. + * Deprecated - only for compatibility. */ - public ApnsCredential apnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().apnsCredential(); - } + @JsonProperty(value = "location") + private String location; - /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential the apnsCredential value to set. - * @return the PnsCredentialsResourceInner object itself. + /* + * Deprecated - only for compatibility. */ - public PnsCredentialsResourceInner withApnsCredential(ApnsCredential apnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withApnsCredential(apnsCredential); - return this; - } + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public WnsCredential wnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().wnsCredential(); - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential the wnsCredential value to set. - * @return the PnsCredentialsResourceInner object itself. + * Creates an instance of PnsCredentialsResourceInner class. */ - public PnsCredentialsResourceInner withWnsCredential(WnsCredential wnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withWnsCredential(wnsCredential); - return this; + public PnsCredentialsResourceInner() { } /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. + * Get the properties property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. + * + * @return the properties value. */ - public GcmCredential gcmCredential() { - return this.innerProperties() == null ? null : this.innerProperties().gcmCredential(); + public PnsCredentials properties() { + return this.properties; } /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential the gcmCredential value to set. + * Set the properties property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. + * + * @param properties the properties value to set. * @return the PnsCredentialsResourceInner object itself. */ - public PnsCredentialsResourceInner withGcmCredential(GcmCredential gcmCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withGcmCredential(gcmCredential); + public PnsCredentialsResourceInner withProperties(PnsCredentials properties) { + this.properties = properties; return this; } /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. + * Get the location property: Deprecated - only for compatibility. + * + * @return the location value. */ - public MpnsCredential mpnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().mpnsCredential(); + public String location() { + return this.location; } /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential the mpnsCredential value to set. + * Set the location property: Deprecated - only for compatibility. + * + * @param location the location value to set. * @return the PnsCredentialsResourceInner object itself. */ - public PnsCredentialsResourceInner withMpnsCredential(MpnsCredential mpnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withMpnsCredential(mpnsCredential); + public PnsCredentialsResourceInner withLocation(String location) { + this.location = location; return this; } /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. + * Get the tags property: Deprecated - only for compatibility. + * + * @return the tags value. */ - public AdmCredential admCredential() { - return this.innerProperties() == null ? null : this.innerProperties().admCredential(); + public Map tags() { + return this.tags; } /** - * Set the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential the admCredential value to set. + * Set the tags property: Deprecated - only for compatibility. + * + * @param tags the tags value to set. * @return the PnsCredentialsResourceInner object itself. */ - public PnsCredentialsResourceInner withAdmCredential(AdmCredential admCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withAdmCredential(admCredential); + public PnsCredentialsResourceInner withTags(Map tags) { + this.tags = tags; return this; } /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public BaiduCredential baiduCredential() { - return this.innerProperties() == null ? null : this.innerProperties().baiduCredential(); - } - - /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential the baiduCredential value to set. - * @return the PnsCredentialsResourceInner object itself. - */ - public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withBaiduCredential(baiduCredential); - return this; + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateEndpointConnectionResourceInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateEndpointConnectionResourceInner.java new file mode 100644 index 000000000000..73bd75517ebb --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateEndpointConnectionResourceInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ +@Fluent +public final class PrivateEndpointConnectionResourceInner extends ProxyResource { + /* + * Private Endpoint Connection properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of PrivateEndpointConnectionResourceInner class. + */ + public PrivateEndpointConnectionResourceInner() { + } + + /** + * Get the properties property: Private Endpoint Connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Private Endpoint Connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionResourceInner object itself. + */ + public PrivateEndpointConnectionResourceInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateLinkResourceInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..1284c8d685c2 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Private Link Arm Resource. + */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Represents properties of Private Link Resource. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + + /** + * Get the properties property: Represents properties of Private Link Resource. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Represents properties of Private Link Resource. + * + * @param properties the properties value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ResourceListKeysInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ResourceListKeysInner.java index 7ad697fcd00a..81ecc7292b5e 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ResourceListKeysInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ResourceListKeysInner.java @@ -4,69 +4,64 @@ package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Namespace/NotificationHub Connection String. */ -@Fluent +/** + * Response for the POST request that returns Namespace or NotificationHub access keys (connection strings). + */ +@Immutable public final class ResourceListKeysInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceListKeysInner.class); - /* - * PrimaryConnectionString of the AuthorizationRule. + * Gets or sets primaryConnectionString of the AuthorizationRule. */ - @JsonProperty(value = "primaryConnectionString") + @JsonProperty(value = "primaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) private String primaryConnectionString; /* - * SecondaryConnectionString of the created AuthorizationRule + * Gets or sets secondaryConnectionString of the created + * AuthorizationRule */ - @JsonProperty(value = "secondaryConnectionString") + @JsonProperty(value = "secondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) private String secondaryConnectionString; /* - * PrimaryKey of the created AuthorizationRule. + * Gets or sets primaryKey of the created AuthorizationRule. */ - @JsonProperty(value = "primaryKey") + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) private String primaryKey; /* - * SecondaryKey of the created AuthorizationRule + * Gets or sets secondaryKey of the created AuthorizationRule */ - @JsonProperty(value = "secondaryKey") + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) private String secondaryKey; /* - * KeyName of the created AuthorizationRule + * Gets or sets keyName of the created AuthorizationRule */ - @JsonProperty(value = "keyName") + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) private String keyName; /** - * Get the primaryConnectionString property: PrimaryConnectionString of the AuthorizationRule. - * - * @return the primaryConnectionString value. + * Creates an instance of ResourceListKeysInner class. */ - public String primaryConnectionString() { - return this.primaryConnectionString; + public ResourceListKeysInner() { } /** - * Set the primaryConnectionString property: PrimaryConnectionString of the AuthorizationRule. - * - * @param primaryConnectionString the primaryConnectionString value to set. - * @return the ResourceListKeysInner object itself. + * Get the primaryConnectionString property: Gets or sets primaryConnectionString of the AuthorizationRule. + * + * @return the primaryConnectionString value. */ - public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { - this.primaryConnectionString = primaryConnectionString; - return this; + public String primaryConnectionString() { + return this.primaryConnectionString; } /** - * Get the secondaryConnectionString property: SecondaryConnectionString of the created AuthorizationRule. - * + * Get the secondaryConnectionString property: Gets or sets secondaryConnectionString of the created + * AuthorizationRule. + * * @return the secondaryConnectionString value. */ public String secondaryConnectionString() { @@ -74,19 +69,8 @@ public String secondaryConnectionString() { } /** - * Set the secondaryConnectionString property: SecondaryConnectionString of the created AuthorizationRule. - * - * @param secondaryConnectionString the secondaryConnectionString value to set. - * @return the ResourceListKeysInner object itself. - */ - public ResourceListKeysInner withSecondaryConnectionString(String secondaryConnectionString) { - this.secondaryConnectionString = secondaryConnectionString; - return this; - } - - /** - * Get the primaryKey property: PrimaryKey of the created AuthorizationRule. - * + * Get the primaryKey property: Gets or sets primaryKey of the created AuthorizationRule. + * * @return the primaryKey value. */ public String primaryKey() { @@ -94,19 +78,8 @@ public String primaryKey() { } /** - * Set the primaryKey property: PrimaryKey of the created AuthorizationRule. - * - * @param primaryKey the primaryKey value to set. - * @return the ResourceListKeysInner object itself. - */ - public ResourceListKeysInner withPrimaryKey(String primaryKey) { - this.primaryKey = primaryKey; - return this; - } - - /** - * Get the secondaryKey property: SecondaryKey of the created AuthorizationRule. - * + * Get the secondaryKey property: Gets or sets secondaryKey of the created AuthorizationRule. + * * @return the secondaryKey value. */ public String secondaryKey() { @@ -114,39 +87,17 @@ public String secondaryKey() { } /** - * Set the secondaryKey property: SecondaryKey of the created AuthorizationRule. - * - * @param secondaryKey the secondaryKey value to set. - * @return the ResourceListKeysInner object itself. - */ - public ResourceListKeysInner withSecondaryKey(String secondaryKey) { - this.secondaryKey = secondaryKey; - return this; - } - - /** - * Get the keyName property: KeyName of the created AuthorizationRule. - * + * Get the keyName property: Gets or sets keyName of the created AuthorizationRule. + * * @return the keyName value. */ public String keyName() { return this.keyName; } - /** - * Set the keyName property: KeyName of the created AuthorizationRule. - * - * @param keyName the keyName value to set. - * @return the ResourceListKeysInner object itself. - */ - public ResourceListKeysInner withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleProperties.java deleted file mode 100644 index dc180123e376..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleProperties.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.AccessRights; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** SharedAccessAuthorizationRule properties. */ -@Fluent -public final class SharedAccessAuthorizationRuleProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedAccessAuthorizationRuleProperties.class); - - /* - * The rights associated with the rule. - */ - @JsonProperty(value = "rights") - private List rights; - - /* - * 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; - - /* - * A string that describes the claim type - */ - @JsonProperty(value = "claimType", access = JsonProperty.Access.WRITE_ONLY) - private String claimType; - - /* - * A string that describes the claim value - */ - @JsonProperty(value = "claimValue", access = JsonProperty.Access.WRITE_ONLY) - private String claimValue; - - /* - * The last modified time for this rule - */ - @JsonProperty(value = "modifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private String modifiedTime; - - /* - * The created time for this rule - */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) - private String createdTime; - - /* - * The revision number for the rule - */ - @JsonProperty(value = "revision", access = JsonProperty.Access.WRITE_ONLY) - private Integer revision; - - /** - * 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 SharedAccessAuthorizationRuleProperties object itself. - */ - public SharedAccessAuthorizationRuleProperties withRights(List rights) { - this.rights = rights; - return this; - } - - /** - * 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; - } - - /** - * Get the claimType property: A string that describes the claim type. - * - * @return the claimType value. - */ - public String claimType() { - return this.claimType; - } - - /** - * Get the claimValue property: A string that describes the claim value. - * - * @return the claimValue value. - */ - public String claimValue() { - return this.claimValue; - } - - /** - * Get the modifiedTime property: The last modified time for this rule. - * - * @return the modifiedTime value. - */ - public String modifiedTime() { - return this.modifiedTime; - } - - /** - * Get the createdTime property: The created time for this rule. - * - * @return the createdTime value. - */ - public String createdTime() { - return this.createdTime; - } - - /** - * Get the revision property: The revision number for the rule. - * - * @return the revision value. - */ - public Integer revision() { - return this.revision; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleResourceInner.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleResourceInner.java index c0c3bbbe4f9e..6257be348841 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleResourceInner.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleResourceInner.java @@ -5,181 +5,127 @@ package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.AccessRights; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; import java.util.Map; -/** Description of a Namespace AuthorizationRules. */ +/** + * Response for POST requests that return single SharedAccessAuthorizationRule. + */ @Fluent -public final class SharedAccessAuthorizationRuleResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedAccessAuthorizationRuleResourceInner.class); - +public final class SharedAccessAuthorizationRuleResourceInner extends ProxyResource { /* - * Properties of the Namespace AuthorizationRule. + * SharedAccessAuthorizationRule properties. */ @JsonProperty(value = "properties") - private SharedAccessAuthorizationRuleProperties innerProperties; + private SharedAccessAuthorizationRuleProperties properties; /* - * The sku of the created namespace + * Deprecated - only for compatibility. */ - @JsonProperty(value = "sku") - private Sku sku; + @JsonProperty(value = "location") + private String location; - /** - * Get the innerProperties property: Properties of the Namespace AuthorizationRule. - * - * @return the innerProperties value. + /* + * Deprecated - only for compatibility. */ - private SharedAccessAuthorizationRuleProperties innerProperties() { - return this.innerProperties; - } + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public Sku sku() { - return this.sku; - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the SharedAccessAuthorizationRuleResourceInner object itself. + * Creates an instance of SharedAccessAuthorizationRuleResourceInner class. */ - public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public SharedAccessAuthorizationRuleResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SharedAccessAuthorizationRuleResourceInner withTags(Map tags) { - super.withTags(tags); - return this; + public SharedAccessAuthorizationRuleResourceInner() { } /** - * Get the rights property: The rights associated with the rule. - * - * @return the rights value. + * Get the properties property: SharedAccessAuthorizationRule properties. + * + * @return the properties value. */ - public List rights() { - return this.innerProperties() == null ? null : this.innerProperties().rights(); + public SharedAccessAuthorizationRuleProperties properties() { + return this.properties; } /** - * Set the rights property: The rights associated with the rule. - * - * @param rights the rights value to set. + * Set the properties property: SharedAccessAuthorizationRule properties. + * + * @param properties the properties value to set. * @return the SharedAccessAuthorizationRuleResourceInner object itself. */ - public SharedAccessAuthorizationRuleResourceInner withRights(List rights) { - if (this.innerProperties() == null) { - this.innerProperties = new SharedAccessAuthorizationRuleProperties(); - } - this.innerProperties().withRights(rights); + public SharedAccessAuthorizationRuleResourceInner + withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.properties = properties; return this; } /** - * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. - * - * @return the primaryKey value. + * Get the location property: Deprecated - only for compatibility. + * + * @return the location value. */ - public String primaryKey() { - return this.innerProperties() == null ? null : this.innerProperties().primaryKey(); + public String location() { + return this.location; } /** - * 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.innerProperties() == null ? null : this.innerProperties().secondaryKey(); - } - - /** - * Get the keyName property: A string that describes the authorization rule. - * - * @return the keyName value. - */ - public String keyName() { - return this.innerProperties() == null ? null : this.innerProperties().keyName(); - } - - /** - * Get the claimType property: A string that describes the claim type. - * - * @return the claimType value. - */ - public String claimType() { - return this.innerProperties() == null ? null : this.innerProperties().claimType(); - } - - /** - * Get the claimValue property: A string that describes the claim value. - * - * @return the claimValue value. + * Set the location property: Deprecated - only for compatibility. + * + * @param location the location value to set. + * @return the SharedAccessAuthorizationRuleResourceInner object itself. */ - public String claimValue() { - return this.innerProperties() == null ? null : this.innerProperties().claimValue(); + public SharedAccessAuthorizationRuleResourceInner withLocation(String location) { + this.location = location; + return this; } /** - * Get the modifiedTime property: The last modified time for this rule. - * - * @return the modifiedTime value. + * Get the tags property: Deprecated - only for compatibility. + * + * @return the tags value. */ - public String modifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().modifiedTime(); + public Map tags() { + return this.tags; } /** - * Get the createdTime property: The created time for this rule. - * - * @return the createdTime value. + * Set the tags property: Deprecated - only for compatibility. + * + * @param tags the tags value to set. + * @return the SharedAccessAuthorizationRuleResourceInner object itself. */ - public String createdTime() { - return this.innerProperties() == null ? null : this.innerProperties().createdTime(); + public SharedAccessAuthorizationRuleResourceInner withTags(Map tags) { + this.tags = tags; + return this; } /** - * Get the revision property: The revision number for the rule. - * - * @return the revision value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public Integer revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/WnsCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/WnsCredentialProperties.java deleted file mode 100644 index 2543b327d496..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/WnsCredentialProperties.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of a NotificationHub WnsCredential. */ -@Fluent -public final class WnsCredentialProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WnsCredentialProperties.class); - - /* - * The package ID for this credential. - */ - @JsonProperty(value = "packageSid") - private String packageSid; - - /* - * The secret key. - */ - @JsonProperty(value = "secretKey") - private String secretKey; - - /* - * The Windows Live endpoint. - */ - @JsonProperty(value = "windowsLiveEndpoint") - private String windowsLiveEndpoint; - - /** - * Get the packageSid property: The package ID for this credential. - * - * @return the packageSid value. - */ - public String packageSid() { - return this.packageSid; - } - - /** - * Set the packageSid property: The package ID for this credential. - * - * @param packageSid the packageSid value to set. - * @return the WnsCredentialProperties object itself. - */ - public WnsCredentialProperties withPackageSid(String packageSid) { - this.packageSid = packageSid; - return this; - } - - /** - * Get the secretKey property: The secret key. - * - * @return the secretKey value. - */ - public String secretKey() { - return this.secretKey; - } - - /** - * Set the secretKey property: The secret key. - * - * @param secretKey the secretKey value to set. - * @return the WnsCredentialProperties object itself. - */ - public WnsCredentialProperties withSecretKey(String secretKey) { - this.secretKey = secretKey; - return this; - } - - /** - * Get the windowsLiveEndpoint property: The Windows Live endpoint. - * - * @return the windowsLiveEndpoint value. - */ - public String windowsLiveEndpoint() { - return this.windowsLiveEndpoint; - } - - /** - * Set the windowsLiveEndpoint property: The Windows Live endpoint. - * - * @param windowsLiveEndpoint the windowsLiveEndpoint value to set. - * @return the WnsCredentialProperties object itself. - */ - public WnsCredentialProperties withWindowsLiveEndpoint(String windowsLiveEndpoint) { - this.windowsLiveEndpoint = windowsLiveEndpoint; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/package-info.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/package-info.java index 19cb916a17da..db55bc8657e5 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/package-info.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for NotificationHubsManagementClient. Azure NotificationHub client. */ +/** + * Package containing the inner data models for NotificationHubsRPClient. + * Microsoft Notification Hubs Resource Provider REST API. + */ package com.azure.resourcemanager.notificationhubs.fluent.models; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/package-info.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/package-info.java index db5c8de53046..4d9193cbc5a3 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/package-info.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for NotificationHubsManagementClient. Azure NotificationHub client. */ +/** + * Package containing the service clients for NotificationHubsRPClient. + * Microsoft Notification Hubs Resource Provider REST API. + */ package com.azure.resourcemanager.notificationhubs.fluent; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/CheckAvailabilityResultImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/CheckAvailabilityResultImpl.java index 224104917636..8d22da60d7eb 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/CheckAvailabilityResultImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/CheckAvailabilityResultImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.notificationhubs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityResult; import com.azure.resourcemanager.notificationhubs.models.Sku; @@ -15,8 +16,7 @@ public final class CheckAvailabilityResultImpl implements CheckAvailabilityResul private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - CheckAvailabilityResultImpl( - CheckAvailabilityResultInner innerObject, + CheckAvailabilityResultImpl(CheckAvailabilityResultInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -34,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public Boolean isAvailiable() { + return this.innerModel().isAvailiable(); + } + public String location() { return this.innerModel().location(); } @@ -47,14 +51,14 @@ public Map tags() { } } - public Boolean isAvailiable() { - return this.innerModel().isAvailiable(); - } - public Sku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public CheckAvailabilityResultInner innerModel() { return this.innerObject; } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/DebugSendResponseImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/DebugSendResponseImpl.java index bcf2fa40e4d2..1009e914fd78 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/DebugSendResponseImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/DebugSendResponseImpl.java @@ -4,9 +4,10 @@ package com.azure.resourcemanager.notificationhubs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner; import com.azure.resourcemanager.notificationhubs.models.DebugSendResponse; -import com.azure.resourcemanager.notificationhubs.models.Sku; +import com.azure.resourcemanager.notificationhubs.models.DebugSendResult; import java.util.Collections; import java.util.Map; @@ -15,8 +16,7 @@ public final class DebugSendResponseImpl implements DebugSendResponse { private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - DebugSendResponseImpl( - DebugSendResponseInner innerObject, + DebugSendResponseImpl(DebugSendResponseInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -34,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public DebugSendResult properties() { + return this.innerModel().properties(); + } + public String location() { return this.innerModel().location(); } @@ -47,20 +51,8 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); - } - - public Float success() { - return this.innerModel().success(); - } - - public Float failure() { - return this.innerModel().failure(); - } - - public Object results() { - return this.innerModel().results(); + public SystemData systemData() { + return this.innerModel().systemData(); } public DebugSendResponseInner innerModel() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespaceResourceImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespaceResourceImpl.java index cf7c11dbcab0..c4ffad0e87f7 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespaceResourceImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespaceResourceImpl.java @@ -4,15 +4,16 @@ package com.azure.resourcemanager.notificationhubs.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.notificationhubs.fluent.models.NamespaceResourceInner; -import com.azure.resourcemanager.notificationhubs.models.NamespaceCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters; +import com.azure.resourcemanager.notificationhubs.models.NamespaceProperties; import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; import com.azure.resourcemanager.notificationhubs.models.Sku; -import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -51,60 +52,24 @@ public Sku sku() { return this.innerModel().sku(); } - public String namePropertiesName() { - return this.innerModel().namePropertiesName(); + public NamespaceProperties properties() { + return this.innerModel().properties(); } - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public String region() { - return this.innerModel().region(); + public Region region() { + return Region.fromName(this.regionName()); } - public String metricId() { - return this.innerModel().metricId(); + public String regionName() { + return this.location(); } - 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 subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public String scaleUnit() { - return this.innerModel().scaleUnit(); - } - - public Boolean enabled() { - return this.innerModel().enabled(); - } - - public Boolean critical() { - return this.innerModel().critical(); - } - - public String dataCenter() { - return this.innerModel().dataCenter(); - } - - public NamespaceType namespaceType() { - return this.innerModel().namespaceType(); + public String resourceGroupName() { + return resourceGroupName; } public NamespaceResourceInner innerModel() { @@ -119,8 +84,6 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag private String namespaceName; - private NamespaceCreateOrUpdateParameters createParameters; - private NamespacePatchParameters updateParameters; public NamespaceResourceImpl withExistingResourceGroup(String resourceGroupName) { @@ -129,31 +92,22 @@ public NamespaceResourceImpl withExistingResourceGroup(String resourceGroupName) } public NamespaceResource create() { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .createOrUpdateWithResponse(resourceGroupName, namespaceName, createParameters, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNamespaces().createOrUpdate(resourceGroupName, + namespaceName, this.innerModel(), Context.NONE); return this; } public NamespaceResource create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .createOrUpdateWithResponse(resourceGroupName, namespaceName, createParameters, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNamespaces().createOrUpdate(resourceGroupName, + namespaceName, this.innerModel(), context); return this; } - NamespaceResourceImpl( - String name, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { + NamespaceResourceImpl(String name, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = new NamespaceResourceInner(); this.serviceManager = serviceManager; this.namespaceName = name; - this.createParameters = new NamespaceCreateOrUpdateParameters(); } public NamespaceResourceImpl update() { @@ -162,147 +116,83 @@ public NamespaceResourceImpl update() { } public NamespaceResource apply() { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .patchWithResponse(resourceGroupName, namespaceName, updateParameters, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, Context.NONE).getValue(); return this; } public NamespaceResource apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .patchWithResponse(resourceGroupName, namespaceName, updateParameters, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNamespaces() + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, context).getValue(); return this; } - NamespaceResourceImpl( - NamespaceResourceInner innerObject, + NamespaceResourceImpl(NamespaceResourceInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "namespaces"); } public NamespaceResource refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); return this; } public NamespaceResource refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .getByResourceGroupWithResponse(resourceGroupName, namespaceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, namespaceName, context).getValue(); return this; } - public NamespaceResourceImpl withLocation(Region location) { - this.createParameters.withLocation(location.toString()); + public Response getPnsCredentialsWithResponse(Context context) { + return serviceManager.namespaces().getPnsCredentialsWithResponse(resourceGroupName, namespaceName, context); + } + + public PnsCredentialsResource getPnsCredentials() { + return serviceManager.namespaces().getPnsCredentials(resourceGroupName, namespaceName); + } + + public NamespaceResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); return this; } - public NamespaceResourceImpl withLocation(String location) { - this.createParameters.withLocation(location); + public NamespaceResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); return this; } - public NamespaceResourceImpl withTags(Map tags) { + public NamespaceResourceImpl withSku(Sku sku) { if (isInCreateMode()) { - this.createParameters.withTags(tags); + this.innerModel().withSku(sku); return this; } else { - this.updateParameters.withTags(tags); + this.updateParameters.withSku(sku); return this; } } - public NamespaceResourceImpl withSku(Sku sku) { + public NamespaceResourceImpl withTags(Map tags) { if (isInCreateMode()) { - this.createParameters.withSku(sku); + this.innerModel().withTags(tags); return this; } else { - this.updateParameters.withSku(sku); + this.updateParameters.withTags(tags); return this; } } - public NamespaceResourceImpl withNamePropertiesName(String namePropertiesName) { - this.createParameters.withNamePropertiesName(namePropertiesName); - return this; - } - - public NamespaceResourceImpl withProvisioningState(String provisioningState) { - this.createParameters.withProvisioningState(provisioningState); - return this; - } - - public NamespaceResourceImpl withRegion(String region) { - this.createParameters.withRegion(region); - return this; - } - - public NamespaceResourceImpl withStatus(String status) { - this.createParameters.withStatus(status); - return this; - } - - public NamespaceResourceImpl withCreatedAt(OffsetDateTime createdAt) { - this.createParameters.withCreatedAt(createdAt); - return this; - } - - public NamespaceResourceImpl withUpdatedAt(OffsetDateTime updatedAt) { - this.createParameters.withUpdatedAt(updatedAt); - return this; - } - - public NamespaceResourceImpl withServiceBusEndpoint(String serviceBusEndpoint) { - this.createParameters.withServiceBusEndpoint(serviceBusEndpoint); - return this; - } - - public NamespaceResourceImpl withSubscriptionId(String subscriptionId) { - this.createParameters.withSubscriptionId(subscriptionId); - return this; - } - - public NamespaceResourceImpl withScaleUnit(String scaleUnit) { - this.createParameters.withScaleUnit(scaleUnit); - return this; - } - - public NamespaceResourceImpl withEnabled(Boolean enabled) { - this.createParameters.withEnabled(enabled); - return this; - } - - public NamespaceResourceImpl withCritical(Boolean critical) { - this.createParameters.withCritical(critical); - return this; - } - - public NamespaceResourceImpl withDataCenter(String dataCenter) { - this.createParameters.withDataCenter(dataCenter); - return this; - } - - public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { - this.createParameters.withNamespaceType(namespaceType); - return this; + public NamespaceResourceImpl withProperties(NamespaceProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } } private boolean isInCreateMode() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesClientImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesClientImpl.java index 98023acf2c61..f97632e8971c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesClientImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesClientImpl.java @@ -31,302 +31,238 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner; import com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -import com.azure.resourcemanager.notificationhubs.models.NamespaceCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.NamespaceListResult; import com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleListResult; 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. */ +/** + * An instance of this class provides access to all the operations defined in NamespacesClient. + */ public final class NamespacesClientImpl implements NamespacesClient { - private final ClientLogger logger = new ClientLogger(NamespacesClientImpl.class); - - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final NamespacesService service; - /** The service client containing this operation class. */ - private final NotificationHubsManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final NotificationHubsRPClientImpl client; /** * Initializes an instance of NamespacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - NamespacesClientImpl(NotificationHubsManagementClientImpl client) { - this.service = - RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + NamespacesClientImpl(NotificationHubsRPClientImpl client) { + this.service + = RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for NotificationHubsManagementClientNamespaces to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for NotificationHubsRPClientNamespaces to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NotificationHubsMana") - private interface NamespacesService { - @Headers({"Content-Type: application/json"}) + @ServiceInterface(name = "NotificationHubsRPCl") + public interface NamespacesService { + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CheckAvailabilityParameters parameters, - @HeaderParam("Accept") String accept, + Mono> checkAvailability(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckAvailabilityParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NamespaceCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> patch( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NamespacePatchParameters parameters, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NamespaceResourceInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, + Mono> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NamespacePatchParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") + @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, + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + Mono> createOrUpdateAuthorizationRule( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SharedAccessAuthorizationRuleResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @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); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules") + @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); + Mono> listAuthorizationRules( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> listKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/AuthorizationRules") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @QueryParam("api-version") String apiVersion, + Mono> regenerateKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/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("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); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PolicyKeyResource parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/pnsCredentials") + @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, + Mono> getPnsCredentials(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PolicykeyResource parameters, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listAllNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. + * + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkAvailabilityWithResponseAsync( - CheckAvailabilityParameters parameters) { + private Mono> + checkAvailabilityWithResponseAsync(CheckAvailabilityParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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.")); @@ -335,44 +271,33 @@ private Mono> checkAvailabilityWithRespon } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .checkAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.checkAvailability(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. + * + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkAvailabilityWithResponseAsync( - CheckAvailabilityParameters parameters, Context context) { + private Mono> + checkAvailabilityWithResponseAsync(CheckAvailabilityParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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.")); @@ -381,91 +306,78 @@ private Mono> checkAvailabilityWithRespon } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .checkAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.checkAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), parameters, accept, context); } /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. + * + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkAvailabilityAsync(CheckAvailabilityParameters parameters) { - return checkAvailabilityWithResponseAsync(parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return checkAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. + * + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { - return checkAvailabilityAsync(parameters).block(); + public Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context) { + return checkAvailabilityWithResponseAsync(parameters, context).block(); } /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. - * @param context The context to associate with this operation. + * + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkAvailabilityWithResponse( - CheckAvailabilityParameters parameters, Context context) { - return checkAvailabilityWithResponseAsync(parameters, context).block(); + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithResponse(parameters, Context.NONE).getValue(); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { + 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.")); + 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 @@ -474,55 +386,36 @@ private Mono> createOrUpdateWithResponseAsync( 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)) + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, Context context) { + 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.")); + 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 @@ -531,113 +424,82 @@ private Mono> createOrUpdateWithResponseAsync( 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); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, this.client.getApiVersion(), accept, context); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NamespaceResourceInner createOrUpdate( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String namespaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. - * @param context The context to associate with this operation. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParameters parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync( - String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -646,12 +508,6 @@ private Mono> patchWithResponseAsync( 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 { @@ -659,41 +515,34 @@ private Mono> patchWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .patch( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync( - String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -702,12 +551,6 @@ private Mono> patchWithResponseAsync( 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 { @@ -715,319 +558,316 @@ private Mono> patchWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .patch( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, this.client.getApiVersion(), parameters, accept, context); } /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the {@link PollerFlux} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync( - String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { - return patchWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NamespaceResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceResourceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NamespaceResourceInner.class, NamespaceResourceInner.class, + this.client.getContext()); } /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the {@link PollerFlux} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NamespaceResourceInner patch( - String resourceGroupName, String namespaceName, NamespacePatchParameters parameters) { - return patchAsync(resourceGroupName, namespaceName, parameters).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NamespaceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String namespaceName, NamespaceResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NamespaceResourceInner.class, NamespaceResourceInner.class, context); } /** - * Patches the existing namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. - * @param context The context to associate with this operation. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse( - String resourceGroupName, String namespaceName, NamespacePatchParameters parameters, Context context) { - return patchWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NamespaceResourceInner> + beginCreateOrUpdate(String resourceGroupName, String namespaceName, NamespaceResourceInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. */ - @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.")); - } - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NamespaceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, NamespaceResourceInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource 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.")); - } - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource. */ - @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); + @ServiceMethod(returns = ReturnType.SINGLE) + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String namespaceName, NamespacePatchParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> updateWithResponseAsync(String resourceGroupName, + String namespaceName, NamespacePatchParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (namespaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, this.client.getApiVersion(), parameters, accept, context); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hubs Namespace Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName) { - deleteAsync(resourceGroupName, namespaceName).block(); + public Response updateWithResponse(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Patches the existing namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, Context context) { - deleteAsync(resourceGroupName, namespaceName, context).block(); + public NamespaceResourceInner update(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters) { + return updateWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE).getValue(); } /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName) { + 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.")); + 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 @@ -1036,47 +876,34 @@ private Mono> getByResourceGroupWithResponseAsy 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { + 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.")); + 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 @@ -1085,458 +912,383 @@ private Mono> getByResourceGroupWithResponseAsy 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); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, this.client.getApiVersion(), accept, context); } /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName).flatMap(ignored -> Mono.empty()); } /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupAsync(resourceGroupName, namespaceName).block(); + public Response deleteWithResponse(String resourceGroupName, String namespaceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, context).block(); } /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + public void delete(String resourceGroupName, String namespaceName) { + deleteWithResponse(resourceGroupName, namespaceName, Context.NONE); } /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + private Mono> listSinglePageAsync(String skipToken, 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 (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be 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(); + 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 - .createOrUpdateAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), skipToken, + top, 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())); } /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, + private Mono> listSinglePageAsync(String skipToken, 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 (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be 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(); + 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 - .createOrUpdateAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), skipToken, top, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top), + nextLink -> listAllNextSinglePageAsync(nextLink)); } /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Lists all the available namespaces within the subscription. + * + * @throws ManagementException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top), + nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skipToken, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top, context), + nextLink -> listAllNextSinglePageAsync(nextLink, context)); } /** - * Creates an authorization rule for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Lists all the available namespaces within the subscription. + * + * @throws ManagementException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(listAsync(skipToken, top)); + } + + /** + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AuthorizationRules. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, parameters, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String skipToken, Integer top, Context context) { + return new PagedIterable<>(listAsync(skipToken, top, context)); } /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skipToken, Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (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(), - context)) + context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, skipToken, top, 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())); } /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skipToken, Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (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(), - context); + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + skipToken, top, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the response of the List Namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap((Response res) -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken, + Integer top) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response of the List Namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken, + Integer top, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 name. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skipToken, top)); + } + + /** + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, + Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skipToken, top, context)); + } + + /** + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1549,49 +1301,44 @@ private Mono> getAuthorizat 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 - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, + this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 name. + * @return response for POST requests that return single SharedAccessAuthorizationRule 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) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1604,413 +1351,371 @@ private Mono> getAuthorizat 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 - .getAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, authorizationRuleName, this.client.getApiVersion(), parameters, accept, + context); } /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 name. + * @return response for POST requests that return single SharedAccessAuthorizationRule on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 name. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, + parameters, context).block(); } /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. - * @param context The context to associate with this operation. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 name. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, + parameters, Context.NONE).getValue(); } /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + 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 (this.client.getSubscriptionId() == 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 this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter authorizationRuleName 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)) + .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + 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.")); + 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 (this.client.getSubscriptionId() == 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 this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter authorizationRuleName 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)); + return service.deleteAuthorizationRule(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, authorizationRuleName, this.client.getApiVersion(), accept, context); } /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(ignored -> Mono.empty()); } /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, + context).block(); } /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); } /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. - * @param context The context to associate with this operation. + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * - * @throws ManagementException thrown 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. + * @return an authorization rule for a namespace by name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + 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.")); + 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 (authorizationRuleName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter authorizationRuleName 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)) + .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return an authorization rule for a namespace by name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + 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.")); + 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 (authorizationRuleName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter authorizationRuleName 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)); + return service.getAuthorizationRule(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, authorizationRuleName, this.client.getApiVersion(), accept, context); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. + * @return an authorization rule for a namespace by name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return an authorization rule for a namespace by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) + .block(); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * - * @param context The context to associate with this operation. + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. + * @return an authorization rule for a namespace by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); } /** * Gets the authorization rules for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @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) { + 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.")); + 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 @@ -2019,56 +1724,39 @@ private Mono> listAuth 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)) + context -> service.listAuthorizationRules(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @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) { + 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.")); + 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 @@ -2077,123 +1765,105 @@ private Mono> listAuth 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)); + .listAuthorizationRules(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, this.client.getApiVersion(), 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 The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @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), + 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 The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @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), + 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 The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName) { + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName) { return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); } /** * Gets the authorization rules for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @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) { + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context) { return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); } /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to 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) { + 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.")); + 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 @@ -2206,49 +1876,36 @@ private Mono> listKeysWithResponseAsync( 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)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, authorizationRuleName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to 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) { + 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.")); + 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 @@ -2261,106 +1918,88 @@ private Mono> listKeysWithResponseAsync( 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); + return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, authorizationRuleName, this.client.getApiVersion(), accept, context); } /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to the namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { + private Mono listKeysAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceListKeysInner listKeys( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); } /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 ConnectionStrings to the namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); } /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, PolicykeyResource parameters) { + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName, PolicyKeyResource parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2373,12 +2012,6 @@ private Mono> regenerateKeysWithResponseAsync( 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 { @@ -2386,47 +2019,36 @@ private Mono> regenerateKeysWithResponseAsync( } 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)) + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, authorizationRuleName, this.client.getApiVersion(), parameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context) { + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName, PolicyKeyResource parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2439,12 +2061,6 @@ private Mono> regenerateKeysWithResponseAsync( 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 { @@ -2452,301 +2068,365 @@ private Mono> regenerateKeysWithResponseAsync( } 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); + return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, authorizationRuleName, this.client.getApiVersion(), parameters, accept, context); } /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, PolicykeyResource parameters) { + private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters) { return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceListKeysInner regenerateKeys( - String resourceGroupName, String namespaceName, String authorizationRuleName, PolicykeyResource parameters) { - return regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).block(); + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters, Context context) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters, + context).block(); } /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters) { + return regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, + Context.NONE).getValue(); + } + + /** + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub PNS Credentials along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPnsCredentialsWithResponseAsync(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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getPnsCredentials(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 namespace/NotificationHub Connection String. + * @return description of a NotificationHub PNS Credentials along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, parameters, context) - .block(); + private Mono> getPnsCredentialsWithResponseAsync(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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getPnsCredentials(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub PNS Credentials on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPnsCredentialsAsync(String resourceGroupName, String namespaceName) { + return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub PNS Credentials along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPnsCredentialsWithResponse(String resourceGroupName, + String namespaceName, Context context) { + return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub PNS Credentials. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName) { + return getPnsCredentialsWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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. + * @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) { + private Mono> listAllNextSinglePageAsync(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.")); + 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)) + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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. + * @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) { + private Mono> listAllNextSinglePageAsync(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.")); + 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)); + return service.listAllNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { + 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.")); + 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.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { + 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.")); + 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 - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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. + * @return the response of 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) { + 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.")); + 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)); + 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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesImpl.java index c64ce4ac778a..246b2e83225a 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesImpl.java @@ -12,31 +12,43 @@ import com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner; import com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityResult; import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; import com.azure.resourcemanager.notificationhubs.models.Namespaces; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import com.azure.resourcemanager.notificationhubs.models.ResourceListKeys; import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleResource; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class NamespacesImpl implements Namespaces { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespacesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(NamespacesImpl.class); private final NamespacesClient innerClient; private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - public NamespacesImpl( - NamespacesClient innerClient, + public NamespacesImpl(NamespacesClient innerClient, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } + public Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context) { + Response inner + = this.serviceClient().checkAvailabilityWithResponse(parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters) { CheckAvailabilityResultInner inner = this.serviceClient().checkAvailability(parameters); if (inner != null) { @@ -46,130 +58,147 @@ public CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters par } } - public Response checkAvailabilityWithResponse( - CheckAvailabilityParameters parameters, Context context) { - Response inner = - this.serviceClient().checkAvailabilityWithResponse(parameters, 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 CheckAvailabilityResultImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NamespaceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName) { + NamespaceResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); + if (inner != null) { + return new NamespaceResourceImpl(inner, this.manager()); } else { return null; } } + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String namespaceName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, context); + } + 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); } - public NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName) { - NamespaceResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); + public PagedIterable list(String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); + } + + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { + Response inner + = this.serviceClient().createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, + authorizationRuleName, parameters, context); if (inner != null) { - return new NamespaceResourceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + public SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleResourceInner parameters) { + SharedAccessAuthorizationRuleResourceInner inner = this.serviceClient() + .createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new NamespaceResourceImpl(inner.getValue(), this.manager())); + return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); } else { return null; } } - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return this.serviceClient().deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, + authorizationRuleName, context); } - public 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 SharedAccessAuthorizationRuleResource getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - SharedAccessAuthorizationRuleResourceInner inner = - this.serviceClient().getAuthorizationRule(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 SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - Response inner = - this - .serviceClient() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + public SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + SharedAccessAuthorizationRuleResourceInner inner + = this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); + return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); } else { return null; } } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); - } - - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName) { - PagedIterable inner = - this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); - return Utils.mapPage(inner, inner1 -> new SharedAccessAuthorizationRuleResourceImpl(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 SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); + 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 ResourceListKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } } public ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - ResourceListKeysInner inner = - this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + ResourceListKeysInner inner + = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); if (inner != null) { return new ResourceListKeysImpl(inner, this.manager()); } else { @@ -177,25 +206,22 @@ public ResourceListKeys listKeys(String resourceGroupName, String namespaceName, } } - public Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - Response inner = - this.serviceClient().listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ResourceListKeysImpl(inner.getValue(), this.manager())); } else { return null; } } - public ResourceListKeys regenerateKeys( - String resourceGroupName, String namespaceName, String authorizationRuleName, PolicykeyResource parameters) { - ResourceListKeysInner inner = - this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + public ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + PolicyKeyResource parameters) { + ResourceListKeysInner inner + = this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); if (inner != null) { return new ResourceListKeysImpl(inner, this.manager()); } else { @@ -203,218 +229,81 @@ public ResourceListKeys regenerateKeys( } } - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context) { - Response inner = - this - .serviceClient() - .regenerateKeysWithResponse( - resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + public Response getPnsCredentialsWithResponse(String resourceGroupName, + String namespaceName, Context context) { + Response inner + = this.serviceClient().getPnsCredentialsWithResponse(resourceGroupName, namespaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ResourceListKeysImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PnsCredentialsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName) { + PnsCredentialsResourceInner inner = this.serviceClient().getPnsCredentials(resourceGroupName, namespaceName); + if (inner != null) { + return new PnsCredentialsResourceImpl(inner, this.manager()); } else { return null; } } public NamespaceResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + 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"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + 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 SharedAccessAuthorizationRuleResource 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"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + 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); + this.deleteByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + 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); + return this.deleteByResourceGroupWithResponse(resourceGroupName, namespaceName, context); } private NamespacesClient serviceClient() { @@ -428,8 +317,4 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag public NamespaceResourceImpl define(String name) { return new NamespaceResourceImpl(name, this.manager()); } - - public SharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { - return new SharedAccessAuthorizationRuleResourceImpl(name, this.manager()); - } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubResourceImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubResourceImpl.java index fcb4c75f9336..0bece5fae3ac 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubResourceImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubResourceImpl.java @@ -6,23 +6,16 @@ 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.notificationhubs.fluent.models.NotificationHubResourceInner; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import com.azure.resourcemanager.notificationhubs.models.AdmCredential; -import com.azure.resourcemanager.notificationhubs.models.ApnsCredential; -import com.azure.resourcemanager.notificationhubs.models.BaiduCredential; import com.azure.resourcemanager.notificationhubs.models.DebugSendResponse; -import com.azure.resourcemanager.notificationhubs.models.GcmCredential; -import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; -import com.azure.resourcemanager.notificationhubs.models.NotificationHubCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.NotificationHubPatchParameters; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties; import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.WnsCredential; import java.util.Collections; -import java.util.List; import java.util.Map; public final class NotificationHubResourceImpl @@ -56,49 +49,16 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); - } - - public String namePropertiesName() { - return this.innerModel().namePropertiesName(); - } - - public String registrationTtl() { - return this.innerModel().registrationTtl(); + public NotificationHubProperties properties() { + return this.innerModel().properties(); } - public List authorizationRules() { - List inner = this.innerModel().authorizationRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ApnsCredential apnsCredential() { - return this.innerModel().apnsCredential(); - } - - public WnsCredential wnsCredential() { - return this.innerModel().wnsCredential(); - } - - public GcmCredential gcmCredential() { - return this.innerModel().gcmCredential(); - } - - public MpnsCredential mpnsCredential() { - return this.innerModel().mpnsCredential(); - } - - public AdmCredential admCredential() { - return this.innerModel().admCredential(); + public Sku sku() { + return this.innerModel().sku(); } - public BaiduCredential baiduCredential() { - return this.innerModel().baiduCredential(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -109,6 +69,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public NotificationHubResourceInner innerModel() { return this.innerObject; } @@ -123,8 +87,6 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag private String notificationHubName; - private NotificationHubCreateOrUpdateParameters createParameters; - private NotificationHubPatchParameters updateParameters; public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { @@ -134,33 +96,24 @@ public NotificationHubResourceImpl withExistingNamespace(String resourceGroupNam } public NotificationHubResource create() { - this.innerObject = - serviceManager - .serviceClient() - .getNotificationHubs() - .createOrUpdateWithResponse( - resourceGroupName, namespaceName, notificationHubName, createParameters, Context.NONE) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getNotificationHubs().createOrUpdateWithResponse(resourceGroupName, + namespaceName, notificationHubName, this.innerModel(), Context.NONE).getValue(); return this; } public NotificationHubResource create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNotificationHubs() - .createOrUpdateWithResponse( - resourceGroupName, namespaceName, notificationHubName, createParameters, context) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getNotificationHubs().createOrUpdateWithResponse(resourceGroupName, + namespaceName, notificationHubName, this.innerModel(), context).getValue(); return this; } - NotificationHubResourceImpl( - String name, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { + NotificationHubResourceImpl(String name, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = new NotificationHubResourceInner(); this.serviceManager = serviceManager; this.notificationHubName = name; - this.createParameters = new NotificationHubCreateOrUpdateParameters(); } public NotificationHubResourceImpl update() { @@ -169,91 +122,72 @@ public NotificationHubResourceImpl update() { } public NotificationHubResource apply() { - this.innerObject = - serviceManager - .serviceClient() - .getNotificationHubs() - .patchWithResponse( - resourceGroupName, namespaceName, notificationHubName, updateParameters, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNotificationHubs() + .updateWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, Context.NONE) + .getValue(); return this; } public NotificationHubResource apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNotificationHubs() - .patchWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNotificationHubs() + .updateWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, context) + .getValue(); return this; } - NotificationHubResourceImpl( - NotificationHubResourceInner innerObject, + NotificationHubResourceImpl(NotificationHubResourceInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); - this.notificationHubName = Utils.getValueFromIdByName(innerObject.id(), "notificationHubs"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.notificationHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "notificationHubs"); } public NotificationHubResource refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getNotificationHubs() - .getWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNotificationHubs() + .getWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE).getValue(); return this; } public NotificationHubResource refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNotificationHubs() - .getWithResponse(resourceGroupName, namespaceName, notificationHubName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNotificationHubs() + .getWithResponse(resourceGroupName, namespaceName, notificationHubName, context).getValue(); return this; } + public Response debugSendWithResponse(Context context) { + return serviceManager.notificationHubs().debugSendWithResponse(resourceGroupName, namespaceName, + notificationHubName, context); + } + public DebugSendResponse debugSend() { return serviceManager.notificationHubs().debugSend(resourceGroupName, namespaceName, notificationHubName); } - public Response debugSendWithResponse(Object parameters, Context context) { - return serviceManager - .notificationHubs() - .debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, context); + public Response getPnsCredentialsWithResponse(Context context) { + return serviceManager.notificationHubs().getPnsCredentialsWithResponse(resourceGroupName, namespaceName, + notificationHubName, context); } public PnsCredentialsResource getPnsCredentials() { - return serviceManager - .notificationHubs() - .getPnsCredentials(resourceGroupName, namespaceName, notificationHubName); - } - - public Response getPnsCredentialsWithResponse(Context context) { - return serviceManager - .notificationHubs() - .getPnsCredentialsWithResponse(resourceGroupName, namespaceName, notificationHubName, context); + return serviceManager.notificationHubs().getPnsCredentials(resourceGroupName, namespaceName, + notificationHubName); } public NotificationHubResourceImpl withRegion(Region location) { - this.createParameters.withLocation(location.toString()); + this.innerModel().withLocation(location.toString()); return this; } public NotificationHubResourceImpl withRegion(String location) { - this.createParameters.withLocation(location); + this.innerModel().withLocation(location); return this; } public NotificationHubResourceImpl withTags(Map tags) { if (isInCreateMode()) { - this.createParameters.withTags(tags); + this.innerModel().withTags(tags); return this; } else { this.updateParameters.withTags(tags); @@ -261,103 +195,22 @@ public NotificationHubResourceImpl withTags(Map tags) { } } - public NotificationHubResourceImpl withSku(Sku sku) { + public NotificationHubResourceImpl withProperties(NotificationHubProperties properties) { if (isInCreateMode()) { - this.createParameters.withSku(sku); + this.innerModel().withProperties(properties); return this; } else { - this.updateParameters.withSku(sku); + this.updateParameters.withProperties(properties); return this; } } - public NotificationHubResourceImpl withNamePropertiesName(String namePropertiesName) { - if (isInCreateMode()) { - this.createParameters.withNamePropertiesName(namePropertiesName); - return this; - } else { - this.updateParameters.withNamePropertiesName(namePropertiesName); - return this; - } - } - - public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { - if (isInCreateMode()) { - this.createParameters.withRegistrationTtl(registrationTtl); - return this; - } else { - this.updateParameters.withRegistrationTtl(registrationTtl); - return this; - } - } - - public NotificationHubResourceImpl withAuthorizationRules( - List authorizationRules) { - if (isInCreateMode()) { - this.createParameters.withAuthorizationRules(authorizationRules); - return this; - } else { - this.updateParameters.withAuthorizationRules(authorizationRules); - return this; - } - } - - public NotificationHubResourceImpl withApnsCredential(ApnsCredential apnsCredential) { - if (isInCreateMode()) { - this.createParameters.withApnsCredential(apnsCredential); - return this; - } else { - this.updateParameters.withApnsCredential(apnsCredential); - return this; - } - } - - public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential) { - if (isInCreateMode()) { - this.createParameters.withWnsCredential(wnsCredential); - return this; - } else { - this.updateParameters.withWnsCredential(wnsCredential); - return this; - } - } - - public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential) { - if (isInCreateMode()) { - this.createParameters.withGcmCredential(gcmCredential); - return this; - } else { - this.updateParameters.withGcmCredential(gcmCredential); - return this; - } - } - - public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredential) { - if (isInCreateMode()) { - this.createParameters.withMpnsCredential(mpnsCredential); - return this; - } else { - this.updateParameters.withMpnsCredential(mpnsCredential); - return this; - } - } - - public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential) { - if (isInCreateMode()) { - this.createParameters.withAdmCredential(admCredential); - return this; - } else { - this.updateParameters.withAdmCredential(admCredential); - return this; - } - } - - public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCredential) { + public NotificationHubResourceImpl withSku(Sku sku) { if (isInCreateMode()) { - this.createParameters.withBaiduCredential(baiduCredential); + this.innerModel().withSku(sku); return this; } else { - this.updateParameters.withBaiduCredential(baiduCredential); + this.updateParameters.withSku(sku); return this; } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsClientImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsClientImpl.java index 049041cadf3d..1675515e49a9 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsClientImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner; @@ -39,318 +38,234 @@ import com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -import com.azure.resourcemanager.notificationhubs.models.NotificationHubCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.NotificationHubListResult; import com.azure.resourcemanager.notificationhubs.models.NotificationHubPatchParameters; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in NotificationHubsClient. */ +/** + * An instance of this class provides access to all the operations defined in NotificationHubsClient. + */ public final class NotificationHubsClientImpl implements NotificationHubsClient { - private final ClientLogger logger = new ClientLogger(NotificationHubsClientImpl.class); - - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final NotificationHubsService service; - /** The service client containing this operation class. */ - private final NotificationHubsManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final NotificationHubsRPClientImpl client; /** * Initializes an instance of NotificationHubsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - NotificationHubsClientImpl(NotificationHubsManagementClientImpl client) { - this.service = - RestProxy.create(NotificationHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + NotificationHubsClientImpl(NotificationHubsRPClientImpl client) { + this.service + = RestProxy.create(NotificationHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for NotificationHubsManagementClientNotificationHubs to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for NotificationHubsRPClientNotificationHubs to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NotificationHubsMana") - private interface NotificationHubsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/checkNotificationHubAvailability") - @ExpectedResponses({200}) + @ServiceInterface(name = "NotificationHubsRPCl") + public interface NotificationHubsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNotificationHubAvailability( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CheckAvailabilityParameters parameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckAvailabilityParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NotificationHubCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> patch( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @QueryParam("api-version") String apiVersion, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NotificationHubResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") NotificationHubPatchParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend") - @ExpectedResponses({201}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> debugSend( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @QueryParam("api-version") String apiVersion, + Mono> debugSend(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") Object parameters, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules" - + "/{authorizationRuleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdateAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("notificationHubName") String notificationHubName, @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + @BodyParam("application/json") SharedAccessAuthorizationRuleResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules" - + "/{authorizationRuleName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("notificationHubName") String notificationHubName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules" - + "/{authorizationRuleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getAuthorizationRule( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("notificationHubName") String notificationHubName, @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.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs") - @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); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAuthorizationRules( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @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.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules" - + "/{authorizationRuleName}/listKeys") - @ExpectedResponses({200}) + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + Mono> listKeys(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("notificationHubName") String notificationHubName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules" - + "/{authorizationRuleName}/regenerateKeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, + Mono> regenerateKeys(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("notificationHubName") String notificationHubName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PolicykeyResource parameters, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PolicyKeyResource parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs" - + "/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getPnsCredentials( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @QueryParam("api-version") String apiVersion, + Mono> getPnsCredentials(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNotificationHubAvailabilityWithResponseAsync( String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -359,12 +274,6 @@ private Mono> checkNotificationHubAvailab 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 { @@ -372,41 +281,35 @@ private Mono> checkNotificationHubAvailab } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .checkNotificationHubAvailability( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.checkNotificationHubAvailability(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, this.client.getApiVersion(), + parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNotificationHubAvailabilityWithResponseAsync( String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -415,12 +318,6 @@ private Mono> checkNotificationHubAvailab 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 { @@ -428,102 +325,86 @@ private Mono> checkNotificationHubAvailab } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .checkNotificationHubAvailability( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.checkNotificationHubAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), parameters, accept, context); } /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNotificationHubAvailabilityAsync( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + private Mono checkNotificationHubAvailabilityAsync(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters) { return checkNotificationHubAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckAvailabilityResultInner checkNotificationHubAvailability( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { - return checkNotificationHubAvailabilityAsync(resourceGroupName, namespaceName, parameters).block(); + public Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context) { + return checkNotificationHubAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters, context) + .block(); } /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 CheckAvailability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNotificationHubAvailabilityWithResponse( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, Context context) { - return checkNotificationHubAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters, context) - .block(); + public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE) + .getValue(); } /** - * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the notification hub along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters) { + private Mono> getWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -536,60 +417,35 @@ private Mono> createOrUpdateWithResponseA return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required 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, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the notification hub along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -602,130 +458,87 @@ private Mono> createOrUpdateWithResponseA return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required 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, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + notificationHubName, this.client.getApiVersion(), accept, context); } /** - * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the notification hub on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono getAsync(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the notification hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NotificationHubResourceInner createOrUpdate( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, notificationHubName, parameters).block(); + public Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); } /** - * Creates/Update a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to the create/update a NotificationHub Resource. - * @param context The context to associate with this operation. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the notification hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubCreateOrUpdateParameters parameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, parameters, context) - .block(); + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE).getValue(); } /** - * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to patch a NotificationHub Resource. + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubPatchParameters parameters) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, NotificationHubResourceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -738,58 +551,42 @@ private Mono> patchWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required 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) { + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { parameters.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .patch( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to patch a NotificationHub Resource. + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubPatchParameters parameters, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, NotificationHubResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -802,146 +599,97 @@ private Mono> patchWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required 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) { + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { parameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .patch( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), parameters, accept, context); } /** - * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to patch a NotificationHub Resource. + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubPatchParameters parameters) { - return patchWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubResourceInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { - final NotificationHubPatchParameters parameters = null; - return patchWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Response createOrUpdateWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, NotificationHubResourceInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters, + context).block(); } /** - * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Update a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NotificationHubResourceInner patch( - String resourceGroupName, String namespaceName, String notificationHubName) { - final NotificationHubPatchParameters parameters = null; - return patchAsync(resourceGroupName, namespaceName, notificationHubName, parameters).block(); + public NotificationHubResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubResourceInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, + Context.NONE).getValue(); } /** * Patch a NotificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Parameters supplied to patch a NotificationHub Resource. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return notification Hub Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - NotificationHubPatchParameters parameters, - Context context) { - return patchWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters, context) - .block(); - } - - /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -954,47 +702,42 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required 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 - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hub Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1007,93 +750,96 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required 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 - .delete( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), parameters, accept, context); } /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return notification Hub Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) - .flatMap((Response res) -> Mono.empty()); + private Mono updateAsync(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { - deleteAsync(resourceGroupName, namespaceName, notificationHubName).block(); + public Response updateWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubPatchParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters, context) + .block(); } /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param context The context to associate with this operation. + * Patch a NotificationHub in a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return notification Hub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); + public NotificationHubResourceInner update(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubPatchParameters parameters) { + return updateWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, Context.NONE) + .getValue(); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, + String notificationHubName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1106,49 +852,35 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); } - if (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, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, + String notificationHubName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1161,106 +893,85 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); } - if (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, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), accept, context); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { - return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono deleteAsync(String resourceGroupName, String namespaceName, String notificationHubName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMap(ignored -> Mono.empty()); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NotificationHubResourceInner get( - String resourceGroupName, String namespaceName, String notificationHubName) { - return getAsync(resourceGroupName, namespaceName, notificationHubName).block(); + public Response deleteWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param context The context to associate with this operation. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); + public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { + deleteWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE); } /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Debug send parameters. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> debugSendWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { + private Mono> listSinglePageAsync(String resourceGroupName, + String namespaceName, String skipToken, Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1269,59 +980,39 @@ private Mono> debugSendWithResponseAsync( if (namespaceName == null) { return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); } - if (notificationHubName == null) { - return Mono - .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); - } - if (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 - .debugSend( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, skipToken, top, 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())); } /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Debug send parameters. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> debugSendWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - Object parameters, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String namespaceName, String skipToken, Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1330,150 +1021,130 @@ private Mono> debugSendWithResponseAsync( if (namespaceName == null) { return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); } - if (notificationHubName == null) { - return Mono - .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); - } - if (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 - .debugSend( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + skipToken, top, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Debug send parameters. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono debugSendAsync( - String resourceGroupName, String namespaceName, String notificationHubName, Object parameters) { - return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName, + String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono debugSendAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { - final Object parameters = null; - return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DebugSendResponseInner debugSend( - String resourceGroupName, String namespaceName, String notificationHubName) { - final Object parameters = null; - return debugSendAsync(resourceGroupName, namespaceName, notificationHubName, parameters).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName, + String skipToken, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName, skipToken, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List NotificationHub operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, skipToken, top)); } /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Debug send parameters. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response debugSendWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - Object parameters, - Context context) { - return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName, + String skipToken, Integer top, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, skipToken, top, context)); } /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { + private Mono> debugSendWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1486,67 +1157,36 @@ private Mono> createOrUpdat return Mono .error(new IllegalArgumentException("Parameter notificationHubName 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, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.debugSend(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context) { + private Mono> debugSendWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1559,141 +1199,90 @@ private Mono> createOrUpdat return Mono .error(new IllegalArgumentException("Parameter notificationHubName 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, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.debugSend(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), accept, context); } /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono debugSendAsync(String resourceGroupName, String namespaceName, + String notificationHubName) { + return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters) - .block(); + public Response debugSendWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context) { + return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); } /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. - * @param context The context to associate with this operation. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, context) - .block(); + public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, + String notificationHubName) { + return debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE).getValue(); } /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1710,53 +1299,45 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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 - .deleteAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context)) + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1773,108 +1354,105 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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 - .deleteAuthorizationRule( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - context); + return service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.getApiVersion(), + parameters, accept, context); } /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return response for POST requests that return single SharedAccessAuthorizationRule on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) - .flatMap((Response res) -> Mono.empty()); + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) - .block(); + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters, context).block(); } /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Creates/Updates an authorization rule for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. - * @param context The context to associate with this operation. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, context) - .block(); + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters, Context.NONE).getValue(); } /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1891,55 +1469,37 @@ private Mono> getAuthorizat 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, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { + private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -1956,116 +1516,93 @@ private Mono> getAuthorizat 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, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.deleteAuthorizationRule(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.getApiVersion(), + accept, context); } /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName).flatMap(ignored -> Mono.empty()); } /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) - .block(); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, context).block(); } /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. - * @param context The context to associate with this operation. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { - return getAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, context) - .block(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, Context.NONE); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 response of the List NotificationHub operation. + * @return an authorization rule for a NotificationHub by name along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String namespaceName) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2074,56 +1611,47 @@ private Mono> listSinglePageAsync( if (namespaceName == null) { return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { + if (notificationHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); + } + if (authorizationRuleName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter authorizationRuleName 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)) + .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List NotificationHub operation. + * @return an authorization rule for a NotificationHub by name along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2132,120 +1660,102 @@ private Mono> listSinglePageAsync( if (namespaceName == null) { return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { + if (notificationHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); + } + if (authorizationRuleName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter authorizationRuleName 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)); + return service.getAuthorizationRule(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, this.client.getApiVersion(), + accept, context); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 response of the List NotificationHub operation. + * @return an authorization rule for a NotificationHub by name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String namespaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List NotificationHub operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String namespaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @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 response of the List NotificationHub operation. + * @return an authorization rule for a NotificationHub by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, context).block(); } /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 response of the List NotificationHub operation. + * @return an authorization rule for a NotificationHub by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, Context.NONE).getValue(); } /** * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( String resourceGroupName, String namespaceName, String notificationHubName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2258,58 +1768,40 @@ private Mono> listAuth return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); } - if (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, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.listAuthorizationRules(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + this.client.getApiVersion(), accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( String resourceGroupName, String namespaceName, String notificationHubName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2322,49 +1814,29 @@ private Mono> listAuth return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); } - if (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, - notificationHubName, - 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)); + .listAuthorizationRules(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), 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 NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { return new PagedFlux<>( () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); @@ -2372,19 +1844,19 @@ private PagedFlux listAuthorizationR /** * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { return new PagedFlux<>( () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName, context), nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); @@ -2392,60 +1864,63 @@ private PagedFlux listAuthorizationR /** * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName) { + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName) { return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName)); } /** * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a NotificationHub. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { return new PagedIterable<>( listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName, context)); } /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2462,55 +1937,38 @@ private Mono> listKeysWithResponseAsync( 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, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2527,121 +1985,95 @@ private Mono> listKeysWithResponseAsync( 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, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, this.client.getApiVersion(), accept, context); } /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + private Mono listKeysAsync(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName) { return listKeysWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceListKeysInner listKeys( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).block(); + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, + context).block(); } /** * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 ConnectionStrings to the NotificationHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { - return listKeysWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, context) - .block(); + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, + Context.NONE).getValue(); } /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters) { + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2658,12 +2090,6 @@ private Mono> regenerateKeysWithResponseAsync( 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 { @@ -2671,50 +2097,38 @@ private Mono> regenerateKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .regenerateKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, + this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters, + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2731,12 +2145,6 @@ private Mono> regenerateKeysWithResponseAsync( 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 { @@ -2744,123 +2152,96 @@ private Mono> regenerateKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .regenerateKeys( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - authorizationRuleName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, this.client.getApiVersion(), parameters, accept, + context); } /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceListKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters) { - return regenerateKeysAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters) - .block(); + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters, context).block(); } /** * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, context) - .block(); + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters) { + return regenerateKeysWithResponse(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, + parameters, Context.NONE).getValue(); } /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub PNS Credentials. + * @return description of a NotificationHub PNS Credentials along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPnsCredentialsWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { + private Mono> getPnsCredentialsWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2873,49 +2254,37 @@ private Mono> getPnsCredentialsWithRespons return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); } - if (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 - .getPnsCredentials( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.getPnsCredentials(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub PNS Credentials. + * @return description of a NotificationHub PNS Credentials along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPnsCredentialsWithResponseAsync( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { + private Mono> getPnsCredentialsWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 @@ -2928,95 +2297,78 @@ private Mono> getPnsCredentialsWithRespons return Mono .error(new IllegalArgumentException("Parameter notificationHubName is required and cannot be null.")); } - if (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 - .getPnsCredentials( - this.client.getEndpoint(), - resourceGroupName, - namespaceName, - notificationHubName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.getPnsCredentials(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, this.client.getApiVersion(), accept, context); } /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub PNS Credentials. + * @return description of a NotificationHub PNS Credentials on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getPnsCredentialsAsync( - String resourceGroupName, String namespaceName, String notificationHubName) { + private Mono getPnsCredentialsAsync(String resourceGroupName, String namespaceName, + String notificationHubName) { return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub PNS Credentials. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PnsCredentialsResourceInner getPnsCredentials( - String resourceGroupName, String namespaceName, String notificationHubName) { - return getPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName).block(); + public Response getPnsCredentialsWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { + return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context) + .block(); } /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param context The context to associate with this operation. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return description of a NotificationHub PNS Credentials. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPnsCredentialsWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context) - .block(); + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getPnsCredentialsWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE) + .getValue(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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 NotificationHub operation. + * @return the response of the List NotificationHub operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -3024,134 +2376,105 @@ private Mono> listNextSinglePageAsyn 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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 NotificationHub operation. + * @return the response of the List NotificationHub operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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. + * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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. + * @return the response of 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) { + 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.")); + 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)); + 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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsImpl.java index c66647900831..a3ca895aa5ee 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsImpl.java @@ -22,454 +22,409 @@ import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; import com.azure.resourcemanager.notificationhubs.models.NotificationHubs; import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import com.azure.resourcemanager.notificationhubs.models.ResourceListKeys; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleResource; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class NotificationHubsImpl implements NotificationHubs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(NotificationHubsImpl.class); private final NotificationHubsClient innerClient; private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - public NotificationHubsImpl( - NotificationHubsClient innerClient, + public NotificationHubsImpl(NotificationHubsClient innerClient, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public CheckAvailabilityResult checkNotificationHubAvailability( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { - CheckAvailabilityResultInner inner = - this.serviceClient().checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters); + public Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context) { + Response inner = this.serviceClient() + .checkNotificationHubAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, context); if (inner != null) { - return new CheckAvailabilityResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response checkNotificationHubAvailabilityWithResponse( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, Context context) { - Response inner = - this - .serviceClient() - .checkNotificationHubAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CheckAvailabilityResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { - this.serviceClient().delete(resourceGroupName, namespaceName, notificationHubName); - } - - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, notificationHubName, context); - } - - public NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName) { - NotificationHubResourceInner inner = - this.serviceClient().get(resourceGroupName, namespaceName, notificationHubName); + public CheckAvailabilityResult checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters) { + CheckAvailabilityResultInner inner + = this.serviceClient().checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters); if (inner != null) { - return new NotificationHubResourceImpl(inner, this.manager()); + return new CheckAvailabilityResultImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, namespaceName, notificationHubName, context); + public Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, namespaceName, notificationHubName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NotificationHubResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public DebugSendResponse debugSend(String resourceGroupName, String namespaceName, String notificationHubName) { - DebugSendResponseInner inner = - this.serviceClient().debugSend(resourceGroupName, namespaceName, notificationHubName); + public NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubResourceInner inner + = this.serviceClient().get(resourceGroupName, namespaceName, notificationHubName); if (inner != null) { - return new DebugSendResponseImpl(inner, this.manager()); + return new NotificationHubResourceImpl(inner, this.manager()); } else { return null; } } - public Response debugSendWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - Object parameters, + public Response deleteWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - Response inner = - this - .serviceClient() - .debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, context); + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, notificationHubName, context); + } + + public void delete(String resourceGroupName, String namespaceName, String notificationHubName) { + this.serviceClient().delete(resourceGroupName, namespaceName, notificationHubName); + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationHubResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String namespaceName, String skipToken, + Integer top, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, namespaceName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationHubResourceImpl(inner1, this.manager())); + } + + public Response debugSendWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context) { + Response inner = this.serviceClient().debugSendWithResponse(resourceGroupName, + namespaceName, notificationHubName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DebugSendResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - SharedAccessAuthorizationRuleResourceInner inner = - this - .serviceClient() - .createOrUpdateAuthorizationRule( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters); + public DebugSendResponse debugSend(String resourceGroupName, String namespaceName, String notificationHubName) { + DebugSendResponseInner inner + = this.serviceClient().debugSend(resourceGroupName, namespaceName, notificationHubName); if (inner != null) { - return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); + return new DebugSendResponseImpl(inner, this.manager()); } else { return null; } } - public Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context) { + return this.serviceClient().deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, context); } - public void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - this - .serviceClient() - .deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName) { + this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName); } - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { - return this - .serviceClient() - .deleteAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, context); - } - - public SharedAccessAuthorizationRuleResource getAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - SharedAccessAuthorizationRuleResourceInner inner = - this - .serviceClient() - .getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + public Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, Context context) { + Response inner + = this.serviceClient().getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, context); if (inner != null) { - return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { - Response inner = - this - .serviceClient() - .getAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, context); + public SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName) { + SharedAccessAuthorizationRuleResourceInner inner = this.serviceClient().getAuthorizationRule(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); + return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list(String resourceGroupName, String namespaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, namespaceName); - return Utils.mapPage(inner, inner1 -> new NotificationHubResourceImpl(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 NotificationHubResourceImpl(inner1, this.manager())); - } - - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName) { - PagedIterable inner = - this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName); - return Utils.mapPage(inner, inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); } - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - PagedIterable inner = - this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, context); - return Utils.mapPage(inner, inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { + PagedIterable inner = this.serviceClient() + .listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); } - public ResourceListKeys listKeys( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - ResourceListKeysInner inner = - this.serviceClient().listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context) { + Response inner = this.serviceClient().listKeysWithResponse(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, context); if (inner != null) { - return new ResourceListKeysImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ResourceListKeysImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context) { - Response inner = - this - .serviceClient() - .listKeysWithResponse( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, context); + public ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName) { + ResourceListKeysInner inner = this.serviceClient().listKeys(resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ResourceListKeysImpl(inner.getValue(), this.manager())); + return new ResourceListKeysImpl(inner, this.manager()); } else { return null; } } - public ResourceListKeys regenerateKeys( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters) { - ResourceListKeysInner inner = - this - .serviceClient() - .regenerateKeys( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters); + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context) { + Response inner = this.serviceClient().regenerateKeysWithResponse(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, parameters, context); if (inner != null) { - return new ResourceListKeysImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ResourceListKeysImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context) { - Response inner = - this - .serviceClient() - .regenerateKeysWithResponse( - resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, context); + public ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName, PolicyKeyResource parameters) { + ResourceListKeysInner inner = this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, parameters); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ResourceListKeysImpl(inner.getValue(), this.manager())); + return new ResourceListKeysImpl(inner, this.manager()); } else { return null; } } - public PnsCredentialsResource getPnsCredentials( - String resourceGroupName, String namespaceName, String notificationHubName) { - PnsCredentialsResourceInner inner = - this.serviceClient().getPnsCredentials(resourceGroupName, namespaceName, notificationHubName); + public Response getPnsCredentialsWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { + Response inner = this.serviceClient() + .getPnsCredentialsWithResponse(resourceGroupName, namespaceName, notificationHubName, context); if (inner != null) { - return new PnsCredentialsResourceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PnsCredentialsResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getPnsCredentialsWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - Response inner = - this - .serviceClient() - .getPnsCredentialsWithResponse(resourceGroupName, namespaceName, notificationHubName, context); + public PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName) { + PnsCredentialsResourceInner inner + = this.serviceClient().getPnsCredentials(resourceGroupName, namespaceName, notificationHubName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PnsCredentialsResourceImpl(inner.getValue(), this.manager())); + return new PnsCredentialsResourceImpl(inner, this.manager()); } else { return null; } } public NotificationHubResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String notificationHubName = Utils.getValueFromIdByName(id, "notificationHubs"); + String notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); if (notificationHubName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); } return this.getWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String notificationHubName = Utils.getValueFromIdByName(id, "notificationHubs"); + String notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); if (notificationHubName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); } return this.getWithResponse(resourceGroupName, namespaceName, notificationHubName, context); } + public SharedAccessAuthorizationRuleResource getAuthorizationRuleById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); + if (notificationHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + } + String authorizationRuleName = ResourceManagerUtils.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, notificationHubName, + authorizationRuleName, Context.NONE).getValue(); + } + + public Response getAuthorizationRuleByIdWithResponse(String id, + Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); + if (notificationHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + } + String authorizationRuleName = ResourceManagerUtils.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, notificationHubName, + authorizationRuleName, context); + } + public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String notificationHubName = Utils.getValueFromIdByName(id, "notificationHubs"); + String notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); if (notificationHubName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); } this.deleteWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + 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"); + String namespaceName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String notificationHubName = Utils.getValueFromIdByName(id, "notificationHubs"); + String notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); if (notificationHubName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); } return this.deleteWithResponse(resourceGroupName, namespaceName, notificationHubName, context); } + public void deleteAuthorizationRuleById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); + if (notificationHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + } + String authorizationRuleName = ResourceManagerUtils.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, notificationHubName, + authorizationRuleName, Context.NONE); + } + + public Response deleteAuthorizationRuleByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 notificationHubName = ResourceManagerUtils.getValueFromIdByName(id, "notificationHubs"); + if (notificationHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'notificationHubs'.", id))); + } + String authorizationRuleName = ResourceManagerUtils.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, notificationHubName, + authorizationRuleName, context); + } + private NotificationHubsClient serviceClient() { return this.innerClient; } @@ -481,4 +436,8 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag public NotificationHubResourceImpl define(String name) { return new NotificationHubResourceImpl(name, this.manager()); } + + public SharedAccessAuthorizationRuleResourceImpl defineAuthorizationRule(String name) { + return new SharedAccessAuthorizationRuleResourceImpl(name, this.manager()); + } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientBuilder.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientBuilder.java deleted file mode 100644 index 20e35f695c91..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the NotificationHubsManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {NotificationHubsManagementClientImpl.class}) -public final class NotificationHubsManagementClientBuilder { - /* - * Gets subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. - */ - private String subscriptionId; - - /** - * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the NotificationHubsManagementClientBuilder. - */ - public NotificationHubsManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the NotificationHubsManagementClientBuilder. - */ - public NotificationHubsManagementClientBuilder 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 NotificationHubsManagementClientBuilder. - */ - public NotificationHubsManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the NotificationHubsManagementClientBuilder. - */ - public NotificationHubsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the NotificationHubsManagementClientBuilder. - */ - public NotificationHubsManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the NotificationHubsManagementClientBuilder. - */ - public NotificationHubsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of NotificationHubsManagementClientImpl with the provided parameters. - * - * @return an instance of NotificationHubsManagementClientImpl. - */ - public NotificationHubsManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - NotificationHubsManagementClientImpl client = - new NotificationHubsManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsRPClientBuilder.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsRPClientBuilder.java new file mode 100644 index 000000000000..bb8c45151f27 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsRPClientBuilder.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.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 NotificationHubsRPClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { NotificationHubsRPClientImpl.class }) +public final class NotificationHubsRPClientBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the NotificationHubsRPClientBuilder. + */ + public NotificationHubsRPClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NotificationHubsRPClientBuilder. + */ + public NotificationHubsRPClientBuilder 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 NotificationHubsRPClientBuilder. + */ + public NotificationHubsRPClientBuilder 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 NotificationHubsRPClientBuilder. + */ + public NotificationHubsRPClientBuilder 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 NotificationHubsRPClientBuilder. + */ + public NotificationHubsRPClientBuilder 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 NotificationHubsRPClientBuilder. + */ + public NotificationHubsRPClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NotificationHubsRPClientImpl with the provided parameters. + * + * @return an instance of NotificationHubsRPClientImpl. + */ + public NotificationHubsRPClientImpl 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(); + NotificationHubsRPClientImpl client = new NotificationHubsRPClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsRPClientImpl.java similarity index 73% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientImpl.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsRPClientImpl.java index fbc07739322e..e34ee028c80f 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsRPClientImpl.java @@ -15,6 +15,7 @@ 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; @@ -23,167 +24,190 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient; import com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient; -import com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsManagementClient; +import com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsRPClient; import com.azure.resourcemanager.notificationhubs.fluent.OperationsClient; +import com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the NotificationHubsManagementClientImpl type. */ -@ServiceClient(builder = NotificationHubsManagementClientBuilder.class) -public final class NotificationHubsManagementClientImpl implements NotificationHubsManagementClient { - private final ClientLogger logger = new ClientLogger(NotificationHubsManagementClientImpl.class); - +/** + * Initializes a new instance of the NotificationHubsRPClientImpl type. + */ +@ServiceClient(builder = NotificationHubsRPClientBuilder.class) +public final class NotificationHubsRPClientImpl implements NotificationHubsRPClient { /** - * Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. + * The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * + * Gets The ID of the target subscription. The value must be an UUID. + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** + * The NotificationHubsClient object to access its operations. + */ + private final NotificationHubsClient notificationHubs; /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. + * Gets the NotificationHubsClient object to access its operations. + * + * @return the NotificationHubsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public NotificationHubsClient getNotificationHubs() { + return this.notificationHubs; } - /** The NamespacesClient object to access its operations. */ + /** + * 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 NotificationHubsClient object to access its operations. */ - private final NotificationHubsClient notificationHubs; + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; /** - * Gets the NotificationHubsClient object to access its operations. - * - * @return the NotificationHubsClient object. + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. */ - public NotificationHubsClient getNotificationHubs() { - return this.notificationHubs; + public OperationsClient getOperations() { + return this.operations; } /** - * Initializes an instance of NotificationHubsManagementClient client. - * + * 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; + } + + /** + * Initializes an instance of NotificationHubsRPClient 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 Gets subscription credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ - NotificationHubsManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + NotificationHubsRPClientImpl(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 = "2017-04-01"; - this.operations = new OperationsClientImpl(this); - this.namespaces = new NamespacesClientImpl(this); + this.apiVersion = "2023-10-01-preview"; this.notificationHubs = new NotificationHubsClientImpl(this); + this.namespaces = new NamespacesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -192,20 +216,17 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + 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. @@ -215,26 +236,15 @@ public Context mergeContext(Context context) { * @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); + 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. @@ -247,24 +257,21 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + 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); + 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); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -323,4 +330,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(NotificationHubsRPClientImpl.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationImpl.java index 8f57a1356d25..986c34f1417c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationImpl.java @@ -7,14 +7,15 @@ import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; import com.azure.resourcemanager.notificationhubs.models.Operation; import com.azure.resourcemanager.notificationhubs.models.OperationDisplay; +import com.azure.resourcemanager.notificationhubs.models.OperationProperties; public final class OperationImpl implements Operation { private OperationInner innerObject; private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - OperationImpl( - OperationInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -27,6 +28,14 @@ public OperationDisplay display() { return this.innerModel().display(); } + public OperationProperties properties() { + return this.innerModel().properties(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationInner innerModel() { return this.innerObject; } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsClientImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsClientImpl.java index d29d2d243105..3da66d8f7dc6 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsClientImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsClientImpl.java @@ -25,130 +25,110 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.notificationhubs.fluent.OperationsClient; import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; import com.azure.resourcemanager.notificationhubs.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ - private final NotificationHubsManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final NotificationHubsRPClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(NotificationHubsManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + OperationsClientImpl(NotificationHubsRPClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for NotificationHubsManagementClientOperations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for NotificationHubsRPClientOperations to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NotificationHubsMana") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) + @ServiceInterface(name = "NotificationHubsRPCl") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.NotificationHubs/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs 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.")); + 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)) + .>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 NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs 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.")); + 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)); + 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 NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -156,26 +136,27 @@ private PagedFlux listAsync() { } /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs 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)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -183,13 +164,14 @@ public PagedIterable list() { } /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -198,12 +180,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -211,35 +196,28 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + 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)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -247,23 +225,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + 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)); + 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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsImpl.java index 57b639649b8b..9f63228665c3 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsImpl.java @@ -11,17 +11,15 @@ import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; import com.azure.resourcemanager.notificationhubs.models.Operation; import com.azure.resourcemanager.notificationhubs.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -29,12 +27,12 @@ public OperationsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.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())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PnsCredentialsResourceImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PnsCredentialsResourceImpl.java index 3cc65e4cf300..0dc04545e3cc 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PnsCredentialsResourceImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PnsCredentialsResourceImpl.java @@ -4,15 +4,10 @@ package com.azure.resourcemanager.notificationhubs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner; -import com.azure.resourcemanager.notificationhubs.models.AdmCredential; -import com.azure.resourcemanager.notificationhubs.models.ApnsCredential; -import com.azure.resourcemanager.notificationhubs.models.BaiduCredential; -import com.azure.resourcemanager.notificationhubs.models.GcmCredential; -import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentials; import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.WnsCredential; import java.util.Collections; import java.util.Map; @@ -21,8 +16,7 @@ public final class PnsCredentialsResourceImpl implements PnsCredentialsResource private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - PnsCredentialsResourceImpl( - PnsCredentialsResourceInner innerObject, + PnsCredentialsResourceImpl(PnsCredentialsResourceInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -40,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public PnsCredentials properties() { + return this.innerModel().properties(); + } + public String location() { return this.innerModel().location(); } @@ -53,32 +51,8 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); - } - - public ApnsCredential apnsCredential() { - return this.innerModel().apnsCredential(); - } - - public WnsCredential wnsCredential() { - return this.innerModel().wnsCredential(); - } - - public GcmCredential gcmCredential() { - return this.innerModel().gcmCredential(); - } - - public MpnsCredential mpnsCredential() { - return this.innerModel().mpnsCredential(); - } - - public AdmCredential admCredential() { - return this.innerModel().admCredential(); - } - - public BaiduCredential baiduCredential() { - return this.innerModel().baiduCredential(); + public SystemData systemData() { + return this.innerModel().systemData(); } public PnsCredentialsResourceInner innerModel() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionResourceImpl.java new file mode 100644 index 000000000000..c00cad98763f --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionResourceImpl.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.notificationhubs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResource; + +public final class PrivateEndpointConnectionResourceImpl implements PrivateEndpointConnectionResource { + private PrivateEndpointConnectionResourceInner innerObject; + + private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; + + PrivateEndpointConnectionResourceImpl(PrivateEndpointConnectionResourceInner innerObject, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager 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 PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..d17b04e2e4fd --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.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.notificationhubs.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResourceListResult; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceListResult; +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 NotificationHubsRPClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(NotificationHubsRPClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubsRPClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NotificationHubsRPCl") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateLinkResources/{subResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGroupId(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("subResourceName") String subResourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGroupIds(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner 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.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, privateEndpointConnectionName, this.client.getApiVersion(), + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner 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.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, privateEndpointConnectionName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a + * sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionResourceInner> + beginUpdateAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), PrivateEndpointConnectionResourceInner.class, + PrivateEndpointConnectionResourceInner.class, this.client.getContext()); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a + * sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionResourceInner> + beginUpdateAsync(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, namespaceName, + privateEndpointConnectionName, parameters, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), PrivateEndpointConnectionResourceInner.class, + PrivateEndpointConnectionResourceInner.class, context); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a + * sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginUpdate(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + return this.beginUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a + * sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginUpdate(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, Context context) { + return this + .beginUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + return beginUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) + .last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + return updateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context) { + return updateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 this.beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 this.beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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(); + } + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * 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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * 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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace 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())); + } + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * 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(); + } + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation 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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation 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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String namespaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName)); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation 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)); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, namespaceName)); + } + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation 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)); + } + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Link Arm Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGroupIdWithResponseAsync(String resourceGroupName, + String namespaceName, String subResourceName) { + 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 (subResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getGroupId(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, subResourceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Link Arm Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGroupIdWithResponseAsync(String resourceGroupName, + String namespaceName, String subResourceName, 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 (subResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter subResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getGroupId(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, subResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Link Arm Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getGroupIdAsync(String resourceGroupName, String namespaceName, + String subResourceName) { + return getGroupIdWithResponseAsync(resourceGroupName, namespaceName, subResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Link Arm Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGroupIdWithResponse(String resourceGroupName, String namespaceName, + String subResourceName, Context context) { + return getGroupIdWithResponseAsync(resourceGroupName, namespaceName, subResourceName, context).block(); + } + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Link Arm Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner getGroupId(String resourceGroupName, String namespaceName, String subResourceName) { + return getGroupIdWithResponse(resourceGroupName, namespaceName, subResourceName, Context.NONE).getValue(); + } + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGroupIdsSinglePageAsync(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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGroupIds(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGroupIdsSinglePageAsync(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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listGroupIds(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGroupIdsAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>(() -> listGroupIdsSinglePageAsync(resourceGroupName, namespaceName)); + } + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGroupIdsAsync(String resourceGroupName, String namespaceName, + Context context) { + return new PagedFlux<>(() -> listGroupIdsSinglePageAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroupIds(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listGroupIdsAsync(resourceGroupName, namespaceName)); + } + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroupIds(String resourceGroupName, String namespaceName, + Context context) { + return new PagedIterable<>(listGroupIdsAsync(resourceGroupName, namespaceName, context)); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..aea9501a468a --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.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.notificationhubs.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnections; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResource; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnectionResource update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + PrivateEndpointConnectionResourceInner inner + = this.serviceClient().update(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters); + if (inner != null) { + return new PrivateEndpointConnectionResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnectionResource update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context) { + PrivateEndpointConnectionResourceInner inner = this.serviceClient().update(resourceGroupName, namespaceName, + privateEndpointConnectionName, parameters, context); + if (inner != null) { + return new PrivateEndpointConnectionResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 PrivateEndpointConnectionResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnectionResource get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionResourceInner inner + = this.serviceClient().get(resourceGroupName, namespaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String namespaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionResourceImpl(inner1, this.manager())); + } + + public Response getGroupIdWithResponse(String resourceGroupName, String namespaceName, + String subResourceName, Context context) { + Response inner + = this.serviceClient().getGroupIdWithResponse(resourceGroupName, namespaceName, subResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResource getGroupId(String resourceGroupName, String namespaceName, String subResourceName) { + PrivateLinkResourceInner inner + = this.serviceClient().getGroupId(resourceGroupName, namespaceName, subResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listGroupIds(String resourceGroupName, String namespaceName) { + PagedIterable inner + = this.serviceClient().listGroupIds(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listGroupIds(String resourceGroupName, String namespaceName, + Context context) { + PagedIterable inner + = this.serviceClient().listGroupIds(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateLinkResourceImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..79155aceeb06 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateLinkResourceImpl.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.notificationhubs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResource; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager 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 PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceListKeysImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceListKeysImpl.java index 015fb23a0268..da8404016e1f 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceListKeysImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceListKeysImpl.java @@ -12,8 +12,7 @@ public final class ResourceListKeysImpl implements ResourceListKeys { private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; - ResourceListKeysImpl( - ResourceListKeysInner innerObject, + ResourceListKeysImpl(ResourceListKeysInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/Utils.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/Utils.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java index 007c16f2410b..7dfe9983b1e4 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/Utils.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(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); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceImpl.java index f791ef4a7514..96e6304c60cd 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceImpl.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceImpl.java @@ -6,23 +6,18 @@ 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.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; -import com.azure.resourcemanager.notificationhubs.models.AccessRights; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import com.azure.resourcemanager.notificationhubs.models.ResourceListKeys; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleResource; -import com.azure.resourcemanager.notificationhubs.models.Sku; import java.util.Collections; -import java.util.List; import java.util.Map; -public final class SharedAccessAuthorizationRuleResourceImpl - implements SharedAccessAuthorizationRuleResource, - SharedAccessAuthorizationRuleResource.Definition, - SharedAccessAuthorizationRuleResource.Update { +public final class SharedAccessAuthorizationRuleResourceImpl implements SharedAccessAuthorizationRuleResource, + SharedAccessAuthorizationRuleResource.Definition, SharedAccessAuthorizationRuleResource.Update { private SharedAccessAuthorizationRuleResourceInner innerObject; private final com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager; @@ -39,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public SharedAccessAuthorizationRuleProperties properties() { + return this.innerModel().properties(); + } + public String location() { return this.innerModel().location(); } @@ -52,49 +51,8 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); - } - - public List rights() { - List inner = this.innerModel().rights(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String primaryKey() { - return this.innerModel().primaryKey(); - } - - public String secondaryKey() { - return this.innerModel().secondaryKey(); - } - - public String keyName() { - return this.innerModel().keyName(); - } - - public String claimType() { - return this.innerModel().claimType(); - } - - public String claimValue() { - return this.innerModel().claimValue(); - } - - public String modifiedTime() { - return this.innerModel().modifiedTime(); - } - - public String createdTime() { - return this.innerModel().createdTime(); - } - - public Integer revision() { - return this.innerModel().revision(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -105,6 +63,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public SharedAccessAuthorizationRuleResourceInner innerModel() { return this.innerObject; } @@ -117,140 +79,125 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag private String namespaceName; - private String authorizationRuleName; - - private SharedAccessAuthorizationRuleCreateOrUpdateParameters createParameters; + private String notificationHubName; - private SharedAccessAuthorizationRuleCreateOrUpdateParameters updateParameters; + private String authorizationRuleName; - public SharedAccessAuthorizationRuleResourceImpl withExistingNamespace( - String resourceGroupName, String namespaceName) { + public SharedAccessAuthorizationRuleResourceImpl withExistingNotificationHub(String resourceGroupName, + String namespaceName, String notificationHubName) { this.resourceGroupName = resourceGroupName; this.namespaceName = namespaceName; + this.notificationHubName = notificationHubName; return this; } public SharedAccessAuthorizationRuleResource create() { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .createOrUpdateAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, authorizationRuleName, createParameters, Context.NONE) + this.innerObject + = serviceManager + .serviceClient().getNotificationHubs().createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, this.innerModel(), Context.NONE) .getValue(); return this; } public SharedAccessAuthorizationRuleResource create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .createOrUpdateAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, authorizationRuleName, createParameters, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNotificationHubs() + .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, this.innerModel(), context) + .getValue(); return this; } - SharedAccessAuthorizationRuleResourceImpl( - String name, com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { + SharedAccessAuthorizationRuleResourceImpl(String name, + com.azure.resourcemanager.notificationhubs.NotificationHubsManager serviceManager) { this.innerObject = new SharedAccessAuthorizationRuleResourceInner(); this.serviceManager = serviceManager; this.authorizationRuleName = name; - this.createParameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); } public SharedAccessAuthorizationRuleResourceImpl update() { - this.updateParameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); return this; } public SharedAccessAuthorizationRuleResource apply() { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .createOrUpdateAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, authorizationRuleName, updateParameters, Context.NONE) + this.innerObject + = serviceManager + .serviceClient().getNotificationHubs().createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, this.innerModel(), Context.NONE) .getValue(); return this; } public SharedAccessAuthorizationRuleResource apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .createOrUpdateAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, authorizationRuleName, updateParameters, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getNotificationHubs() + .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, this.innerModel(), context) + .getValue(); return this; } - SharedAccessAuthorizationRuleResourceImpl( - SharedAccessAuthorizationRuleResourceInner innerObject, + SharedAccessAuthorizationRuleResourceImpl(SharedAccessAuthorizationRuleResourceInner innerObject, com.azure.resourcemanager.notificationhubs.NotificationHubsManager 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"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.notificationHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "notificationHubs"); + this.authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "authorizationRules"); } public SharedAccessAuthorizationRuleResource refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getNotificationHubs().getAuthorizationRuleWithResponse(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, Context.NONE).getValue(); return this; } public SharedAccessAuthorizationRuleResource refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getNamespaces() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getNotificationHubs().getAuthorizationRuleWithResponse(resourceGroupName, + namespaceName, notificationHubName, authorizationRuleName, context).getValue(); return this; } + public Response listKeysWithResponse(Context context) { + return serviceManager.notificationHubs().listKeysWithResponse(resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, context); + } + public ResourceListKeys listKeys() { - return serviceManager.namespaces().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + return serviceManager.notificationHubs().listKeys(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName); } - public Response listKeysWithResponse(Context context) { - return serviceManager - .namespaces() - .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + public Response regenerateKeysWithResponse(PolicyKeyResource parameters, Context context) { + return serviceManager.notificationHubs().regenerateKeysWithResponse(resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, parameters, context); } - public ResourceListKeys regenerateKeys(PolicykeyResource parameters) { - return serviceManager - .namespaces() - .regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + public ResourceListKeys regenerateKeys(PolicyKeyResource parameters) { + return serviceManager.notificationHubs().regenerateKeys(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters); } - public Response regenerateKeysWithResponse(PolicykeyResource parameters, Context context) { - return serviceManager - .namespaces() - .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + public SharedAccessAuthorizationRuleResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; } - public SharedAccessAuthorizationRuleResourceImpl withProperties( - SharedAccessAuthorizationRuleProperties properties) { - if (isInCreateMode()) { - this.createParameters.withProperties(properties); - return this; - } else { - this.updateParameters.withProperties(properties); - return this; - } + public SharedAccessAuthorizationRuleResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public SharedAccessAuthorizationRuleResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SharedAccessAuthorizationRuleResourceImpl + withProperties(SharedAccessAuthorizationRuleProperties properties) { + this.innerModel().withProperties(properties); + return this; } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/package-info.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/package-info.java index ca1c8efbd029..f9124becc1e5 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/package-info.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for NotificationHubsManagementClient. Azure NotificationHub client. */ +/** + * Package containing the implementations for NotificationHubsRPClient. + * Microsoft Notification Hubs Resource Provider REST API. + */ package com.azure.resourcemanager.notificationhubs.implementation; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AccessRights.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AccessRights.java index abe4c32bbd32..c8cdc81deb86 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AccessRights.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AccessRights.java @@ -4,47 +4,55 @@ package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; -/** Defines values for AccessRights. */ -public enum AccessRights { - /** Enum value Manage. */ - MANAGE("Manage"), - - /** Enum value Send. */ - SEND("Send"), +/** + * Defines values for AccessRights. + */ +public final class AccessRights extends ExpandableStringEnum { + /** + * Static value Manage for AccessRights. + */ + public static final AccessRights MANAGE = fromString("Manage"); - /** Enum value Listen. */ - LISTEN("Listen"); + /** + * Static value Send for AccessRights. + */ + public static final AccessRights SEND = fromString("Send"); - /** The actual serialized value for a AccessRights instance. */ - private final String value; + /** + * Static value Listen for AccessRights. + */ + public static final AccessRights LISTEN = fromString("Listen"); - AccessRights(String value) { - this.value = value; + /** + * Creates a new instance of AccessRights value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessRights() { } /** - * 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. + * Creates or finds a AccessRights from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRights. */ @JsonCreator - public static AccessRights fromString(String value) { - AccessRights[] items = AccessRights.values(); - for (AccessRights item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static AccessRights fromString(String name) { + return fromString(name, AccessRights.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known AccessRights values. + * + * @return known AccessRights values. + */ + public static Collection values() { + return values(AccessRights.class); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredential.java index 05e8771693af..12208f7c6dd4 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredential.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredential.java @@ -6,107 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.AdmCredentialProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub AdmCredential. */ +/** + * Description of a NotificationHub AdmCredential. + */ @Fluent public final class AdmCredential { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdmCredential.class); - /* - * Properties of NotificationHub AdmCredential. + * Description of a NotificationHub AdmCredential. */ - @JsonProperty(value = "properties") - private AdmCredentialProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private AdmCredentialProperties properties; /** - * Get the innerProperties property: Properties of NotificationHub AdmCredential. - * - * @return the innerProperties value. + * Creates an instance of AdmCredential class. */ - private AdmCredentialProperties innerProperties() { - return this.innerProperties; + public AdmCredential() { } /** - * Get the clientId property: The client identifier. - * - * @return the clientId value. + * Get the properties property: Description of a NotificationHub AdmCredential. + * + * @return the properties value. */ - public String clientId() { - return this.innerProperties() == null ? null : this.innerProperties().clientId(); + public AdmCredentialProperties properties() { + return this.properties; } /** - * Set the clientId property: The client identifier. - * - * @param clientId the clientId value to set. + * Set the properties property: Description of a NotificationHub AdmCredential. + * + * @param properties the properties value to set. * @return the AdmCredential object itself. */ - public AdmCredential withClientId(String clientId) { - if (this.innerProperties() == null) { - this.innerProperties = new AdmCredentialProperties(); - } - this.innerProperties().withClientId(clientId); - return this; - } - - /** - * Get the clientSecret property: The credential secret access key. - * - * @return the clientSecret value. - */ - public String clientSecret() { - return this.innerProperties() == null ? null : this.innerProperties().clientSecret(); - } - - /** - * Set the clientSecret property: The credential secret access key. - * - * @param clientSecret the clientSecret value to set. - * @return the AdmCredential object itself. - */ - public AdmCredential withClientSecret(String clientSecret) { - if (this.innerProperties() == null) { - this.innerProperties = new AdmCredentialProperties(); - } - this.innerProperties().withClientSecret(clientSecret); - return this; - } - - /** - * Get the authTokenUrl property: The URL of the authorization token. - * - * @return the authTokenUrl value. - */ - public String authTokenUrl() { - return this.innerProperties() == null ? null : this.innerProperties().authTokenUrl(); - } - - /** - * Set the authTokenUrl property: The URL of the authorization token. - * - * @param authTokenUrl the authTokenUrl value to set. - * @return the AdmCredential object itself. - */ - public AdmCredential withAuthTokenUrl(String authTokenUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new AdmCredentialProperties(); - } - this.innerProperties().withAuthTokenUrl(authTokenUrl); + public AdmCredential withProperties(AdmCredentialProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model AdmCredential")); + } else { + properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AdmCredential.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/AdmCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredentialProperties.java similarity index 54% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/AdmCredentialProperties.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredentialProperties.java index 7fe79588aac0..1eaced3270da 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/AdmCredentialProperties.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredentialProperties.java @@ -2,39 +2,44 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.notificationhubs.fluent.models; +package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub AdmCredential. */ +/** + * Description of a NotificationHub AdmCredential. + */ @Fluent public final class AdmCredentialProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdmCredentialProperties.class); - /* - * The client identifier. + * Gets or sets the client identifier. */ @JsonProperty(value = "clientId") private String clientId; /* - * The credential secret access key. + * Gets or sets the credential secret access key. */ @JsonProperty(value = "clientSecret") private String clientSecret; /* - * The URL of the authorization token. + * Gets or sets the URL of the authorization token. */ @JsonProperty(value = "authTokenUrl") private String authTokenUrl; /** - * Get the clientId property: The client identifier. - * + * Creates an instance of AdmCredentialProperties class. + */ + public AdmCredentialProperties() { + } + + /** + * Get the clientId property: Gets or sets the client identifier. + * * @return the clientId value. */ public String clientId() { @@ -42,8 +47,8 @@ public String clientId() { } /** - * Set the clientId property: The client identifier. - * + * Set the clientId property: Gets or sets the client identifier. + * * @param clientId the clientId value to set. * @return the AdmCredentialProperties object itself. */ @@ -53,8 +58,8 @@ public AdmCredentialProperties withClientId(String clientId) { } /** - * Get the clientSecret property: The credential secret access key. - * + * Get the clientSecret property: Gets or sets the credential secret access key. + * * @return the clientSecret value. */ public String clientSecret() { @@ -62,8 +67,8 @@ public String clientSecret() { } /** - * Set the clientSecret property: The credential secret access key. - * + * Set the clientSecret property: Gets or sets the credential secret access key. + * * @param clientSecret the clientSecret value to set. * @return the AdmCredentialProperties object itself. */ @@ -73,8 +78,8 @@ public AdmCredentialProperties withClientSecret(String clientSecret) { } /** - * Get the authTokenUrl property: The URL of the authorization token. - * + * Get the authTokenUrl property: Gets or sets the URL of the authorization token. + * * @return the authTokenUrl value. */ public String authTokenUrl() { @@ -82,8 +87,8 @@ public String authTokenUrl() { } /** - * Set the authTokenUrl property: The URL of the authorization token. - * + * Set the authTokenUrl property: Gets or sets the URL of the authorization token. + * * @param authTokenUrl the authTokenUrl value to set. * @return the AdmCredentialProperties object itself. */ @@ -94,9 +99,23 @@ public AdmCredentialProperties withAuthTokenUrl(String authTokenUrl) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (clientId() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property clientId in model AdmCredentialProperties")); + } + if (clientSecret() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property clientSecret in model AdmCredentialProperties")); + } + if (authTokenUrl() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property authTokenUrl in model AdmCredentialProperties")); + } } + + private static final ClientLogger LOGGER = new ClientLogger(AdmCredentialProperties.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredential.java index bfbfac3238d7..55994cf4d88b 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredential.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredential.java @@ -6,236 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.ApnsCredentialProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub ApnsCredential. */ +/** + * Description of a NotificationHub ApnsCredential. + */ @Fluent public final class ApnsCredential { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApnsCredential.class); - /* - * Properties of NotificationHub ApnsCredential. - */ - @JsonProperty(value = "properties") - private ApnsCredentialProperties innerProperties; - - /** - * Get the innerProperties property: Properties of NotificationHub ApnsCredential. - * - * @return the innerProperties value. - */ - private ApnsCredentialProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. - * - * @return the apnsCertificate value. - */ - public String apnsCertificate() { - return this.innerProperties() == null ? null : this.innerProperties().apnsCertificate(); - } - - /** - * Set the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. - * - * @param apnsCertificate the apnsCertificate value to set. - * @return the ApnsCredential object itself. - */ - public ApnsCredential withApnsCertificate(String apnsCertificate) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withApnsCertificate(apnsCertificate); - return this; - } - - /** - * Get the certificateKey property: The APNS certificate password if it exists. - * - * @return the certificateKey value. - */ - public String certificateKey() { - return this.innerProperties() == null ? null : this.innerProperties().certificateKey(); - } - - /** - * Set the certificateKey property: The APNS certificate password if it exists. - * - * @param certificateKey the certificateKey value to set. - * @return the ApnsCredential object itself. - */ - public ApnsCredential withCertificateKey(String certificateKey) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withCertificateKey(certificateKey); - return this; - } - - /** - * Get the endpoint property: The APNS endpoint of this credential. If using Certificate Authentication Mode and - * Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify - * 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify - * 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify - * 'https://api.push.apple.com:443/3/device'. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.innerProperties() == null ? null : this.innerProperties().endpoint(); - } - - /** - * Set the endpoint property: The APNS endpoint of this credential. If using Certificate Authentication Mode and - * Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify - * 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify - * 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify - * 'https://api.push.apple.com:443/3/device'. - * - * @param endpoint the endpoint value to set. - * @return the ApnsCredential object itself. - */ - public ApnsCredential withEndpoint(String endpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withEndpoint(endpoint); - return this; - } - - /** - * Get the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Set the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. - * - * @param thumbprint the thumbprint value to set. - * @return the ApnsCredential object itself. - */ - public ApnsCredential withThumbprint(String thumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withThumbprint(thumbprint); - return this; - } - - /** - * Get the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. - * - * @return the keyId value. - */ - public String keyId() { - return this.innerProperties() == null ? null : this.innerProperties().keyId(); - } - - /** - * Set the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. - * - * @param keyId the keyId value to set. - * @return the ApnsCredential object itself. - */ - public ApnsCredential withKeyId(String keyId) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withKeyId(keyId); - return this; - } - - /** - * Get the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. - * - * @return the appName value. - */ - public String appName() { - return this.innerProperties() == null ? null : this.innerProperties().appName(); - } - - /** - * Set the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. - * - * @param appName the appName value to set. - * @return the ApnsCredential object itself. - */ - public ApnsCredential withAppName(String appName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withAppName(appName); - return this; - } - - /** - * Get the appId property: The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from - * your developer account. Specify if using Token Authentication Mode. - * - * @return the appId value. + * Description of a NotificationHub ApnsCredential. */ - public String appId() { - return this.innerProperties() == null ? null : this.innerProperties().appId(); - } + @JsonProperty(value = "properties", required = true) + private ApnsCredentialProperties properties; /** - * Set the appId property: The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from - * your developer account. Specify if using Token Authentication Mode. - * - * @param appId the appId value to set. - * @return the ApnsCredential object itself. + * Creates an instance of ApnsCredential class. */ - public ApnsCredential withAppId(String appId) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withAppId(appId); - return this; + public ApnsCredential() { } /** - * Get the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. - * - * @return the token value. + * Get the properties property: Description of a NotificationHub ApnsCredential. + * + * @return the properties value. */ - public String token() { - return this.innerProperties() == null ? null : this.innerProperties().token(); + public ApnsCredentialProperties properties() { + return this.properties; } /** - * Set the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. - * - * @param token the token value to set. + * Set the properties property: Description of a NotificationHub ApnsCredential. + * + * @param properties the properties value to set. * @return the ApnsCredential object itself. */ - public ApnsCredential withToken(String token) { - if (this.innerProperties() == null) { - this.innerProperties = new ApnsCredentialProperties(); - } - this.innerProperties().withToken(token); + public ApnsCredential withProperties(ApnsCredentialProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model ApnsCredential")); + } else { + properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ApnsCredential.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredentialProperties.java new file mode 100644 index 000000000000..e555cb3b3641 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredentialProperties.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub ApnsCredential. + */ +@Fluent +public final class ApnsCredentialProperties { + /* + * Gets or sets the APNS certificate. + */ + @JsonProperty(value = "apnsCertificate") + private String apnsCertificate; + + /* + * Gets or sets the certificate key. + */ + @JsonProperty(value = "certificateKey") + private String certificateKey; + + /* + * Gets or sets the endpoint of this credential. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /* + * Gets or sets the APNS certificate Thumbprint + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account + */ + @JsonProperty(value = "keyId") + private String keyId; + + /* + * Gets or sets the name of the application + */ + @JsonProperty(value = "appName") + private String appName; + + /* + * Gets or sets the issuer (iss) registered claim key, whose value is + * your 10-character Team ID, obtained from your developer account + */ + @JsonProperty(value = "appId") + private String appId; + + /* + * Gets or sets provider Authentication Token, obtained through your + * developer account + */ + @JsonProperty(value = "token") + private String token; + + /** + * Creates an instance of ApnsCredentialProperties class. + */ + public ApnsCredentialProperties() { + } + + /** + * Get the apnsCertificate property: Gets or sets the APNS certificate. + * + * @return the apnsCertificate value. + */ + public String apnsCertificate() { + return this.apnsCertificate; + } + + /** + * Set the apnsCertificate property: Gets or sets the APNS certificate. + * + * @param apnsCertificate the apnsCertificate value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withApnsCertificate(String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * Get the certificateKey property: Gets or sets the certificate key. + * + * @return the certificateKey value. + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificateKey property: Gets or sets the certificate key. + * + * @param certificateKey the certificateKey value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the endpoint property: Gets or sets the endpoint of this credential. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: Gets or sets the endpoint of this credential. + * + * @param endpoint the endpoint value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the thumbprint property: Gets or sets the APNS certificate Thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Gets or sets the APNS certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the keyId property: Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account. + * + * @param keyId the keyId value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the appName property: Gets or sets the name of the application. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Set the appName property: Gets or sets the name of the application. + * + * @param appName the appName value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the appId property: Gets or sets the issuer (iss) registered claim key, whose value is + * your 10-character Team ID, obtained from your developer account. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId property: Gets or sets the issuer (iss) registered claim key, whose value is + * your 10-character Team ID, obtained from your developer account. + * + * @param appId the appId value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the token property: Gets or sets provider Authentication Token, obtained through your + * developer account. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: Gets or sets provider Authentication Token, obtained through your + * developer account. + * + * @param token the token value to set. + * @return the ApnsCredentialProperties object itself. + */ + public ApnsCredentialProperties withToken(String token) { + this.token = token; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoint() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property endpoint in model ApnsCredentialProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApnsCredentialProperties.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Availability.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Availability.java new file mode 100644 index 000000000000..d1ed1f601ce1 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Availability.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents metric availability (part of RP operation descriptions). + */ +@Immutable +public final class Availability { + /* + * Time grain of the availability. + */ + @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY) + private String timeGrain; + + /* + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration", access = JsonProperty.Access.WRITE_ONLY) + private String blobDuration; + + /** + * Creates an instance of Availability class. + */ + public Availability() { + } + + /** + * Get the timeGrain property: Time grain of the availability. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Get the blobDuration property: Duration of the availability blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredential.java index 7c2d552d066c..eb7452397965 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredential.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredential.java @@ -6,107 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.BaiduCredentialProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub BaiduCredential. */ +/** + * Description of a NotificationHub BaiduCredential. + */ @Fluent public final class BaiduCredential { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaiduCredential.class); - /* - * Properties of NotificationHub BaiduCredential. + * Description of a NotificationHub BaiduCredential. */ - @JsonProperty(value = "properties") - private BaiduCredentialProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private BaiduCredentialProperties properties; /** - * Get the innerProperties property: Properties of NotificationHub BaiduCredential. - * - * @return the innerProperties value. + * Creates an instance of BaiduCredential class. */ - private BaiduCredentialProperties innerProperties() { - return this.innerProperties; + public BaiduCredential() { } /** - * Get the baiduApiKey property: Baidu Api Key. - * - * @return the baiduApiKey value. + * Get the properties property: Description of a NotificationHub BaiduCredential. + * + * @return the properties value. */ - public String baiduApiKey() { - return this.innerProperties() == null ? null : this.innerProperties().baiduApiKey(); + public BaiduCredentialProperties properties() { + return this.properties; } /** - * Set the baiduApiKey property: Baidu Api Key. - * - * @param baiduApiKey the baiduApiKey value to set. + * Set the properties property: Description of a NotificationHub BaiduCredential. + * + * @param properties the properties value to set. * @return the BaiduCredential object itself. */ - public BaiduCredential withBaiduApiKey(String baiduApiKey) { - if (this.innerProperties() == null) { - this.innerProperties = new BaiduCredentialProperties(); - } - this.innerProperties().withBaiduApiKey(baiduApiKey); - return this; - } - - /** - * Get the baiduEndPoint property: Baidu Endpoint. - * - * @return the baiduEndPoint value. - */ - public String baiduEndPoint() { - return this.innerProperties() == null ? null : this.innerProperties().baiduEndPoint(); - } - - /** - * Set the baiduEndPoint property: Baidu Endpoint. - * - * @param baiduEndPoint the baiduEndPoint value to set. - * @return the BaiduCredential object itself. - */ - public BaiduCredential withBaiduEndPoint(String baiduEndPoint) { - if (this.innerProperties() == null) { - this.innerProperties = new BaiduCredentialProperties(); - } - this.innerProperties().withBaiduEndPoint(baiduEndPoint); - return this; - } - - /** - * Get the baiduSecretKey property: Baidu Secret Key. - * - * @return the baiduSecretKey value. - */ - public String baiduSecretKey() { - return this.innerProperties() == null ? null : this.innerProperties().baiduSecretKey(); - } - - /** - * Set the baiduSecretKey property: Baidu Secret Key. - * - * @param baiduSecretKey the baiduSecretKey value to set. - * @return the BaiduCredential object itself. - */ - public BaiduCredential withBaiduSecretKey(String baiduSecretKey) { - if (this.innerProperties() == null) { - this.innerProperties = new BaiduCredentialProperties(); - } - this.innerProperties().withBaiduSecretKey(baiduSecretKey); + public BaiduCredential withProperties(BaiduCredentialProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model BaiduCredential")); + } else { + properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(BaiduCredential.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BaiduCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredentialProperties.java similarity index 56% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BaiduCredentialProperties.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredentialProperties.java index 2f24be391677..6cc95b832bf1 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BaiduCredentialProperties.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredentialProperties.java @@ -2,39 +2,44 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.notificationhubs.fluent.models; +package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub BaiduCredential. */ +/** + * Description of a NotificationHub BaiduCredential. + */ @Fluent public final class BaiduCredentialProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaiduCredentialProperties.class); - /* - * Baidu Api Key. + * Gets or sets baidu Api Key. */ @JsonProperty(value = "baiduApiKey") private String baiduApiKey; /* - * Baidu Endpoint. + * Gets or sets baidu Endpoint. */ @JsonProperty(value = "baiduEndPoint") private String baiduEndPoint; /* - * Baidu Secret Key + * Gets or sets baidu Secret Key */ @JsonProperty(value = "baiduSecretKey") private String baiduSecretKey; /** - * Get the baiduApiKey property: Baidu Api Key. - * + * Creates an instance of BaiduCredentialProperties class. + */ + public BaiduCredentialProperties() { + } + + /** + * Get the baiduApiKey property: Gets or sets baidu Api Key. + * * @return the baiduApiKey value. */ public String baiduApiKey() { @@ -42,8 +47,8 @@ public String baiduApiKey() { } /** - * Set the baiduApiKey property: Baidu Api Key. - * + * Set the baiduApiKey property: Gets or sets baidu Api Key. + * * @param baiduApiKey the baiduApiKey value to set. * @return the BaiduCredentialProperties object itself. */ @@ -53,8 +58,8 @@ public BaiduCredentialProperties withBaiduApiKey(String baiduApiKey) { } /** - * Get the baiduEndPoint property: Baidu Endpoint. - * + * Get the baiduEndPoint property: Gets or sets baidu Endpoint. + * * @return the baiduEndPoint value. */ public String baiduEndPoint() { @@ -62,8 +67,8 @@ public String baiduEndPoint() { } /** - * Set the baiduEndPoint property: Baidu Endpoint. - * + * Set the baiduEndPoint property: Gets or sets baidu Endpoint. + * * @param baiduEndPoint the baiduEndPoint value to set. * @return the BaiduCredentialProperties object itself. */ @@ -73,8 +78,8 @@ public BaiduCredentialProperties withBaiduEndPoint(String baiduEndPoint) { } /** - * Get the baiduSecretKey property: Baidu Secret Key. - * + * Get the baiduSecretKey property: Gets or sets baidu Secret Key. + * * @return the baiduSecretKey value. */ public String baiduSecretKey() { @@ -82,8 +87,8 @@ public String baiduSecretKey() { } /** - * Set the baiduSecretKey property: Baidu Secret Key. - * + * Set the baiduSecretKey property: Gets or sets baidu Secret Key. + * * @param baiduSecretKey the baiduSecretKey value to set. * @return the BaiduCredentialProperties object itself. */ @@ -94,9 +99,23 @@ public BaiduCredentialProperties withBaiduSecretKey(String baiduSecretKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (baiduApiKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property baiduApiKey in model BaiduCredentialProperties")); + } + if (baiduEndPoint() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property baiduEndPoint in model BaiduCredentialProperties")); + } + if (baiduSecretKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property baiduSecretKey in model BaiduCredentialProperties")); + } } + + private static final ClientLogger LOGGER = new ClientLogger(BaiduCredentialProperties.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredential.java new file mode 100644 index 000000000000..e062164b2486 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredential.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub BrowserCredential. + */ +@Fluent +public final class BrowserCredential { + /* + * Description of a NotificationHub BrowserCredential. + */ + @JsonProperty(value = "properties", required = true) + private BrowserCredentialProperties properties; + + /** + * Creates an instance of BrowserCredential class. + */ + public BrowserCredential() { + } + + /** + * Get the properties property: Description of a NotificationHub BrowserCredential. + * + * @return the properties value. + */ + public BrowserCredentialProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Description of a NotificationHub BrowserCredential. + * + * @param properties the properties value to set. + * @return the BrowserCredential object itself. + */ + public BrowserCredential withProperties(BrowserCredentialProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model BrowserCredential")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BrowserCredential.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredentialProperties.java new file mode 100644 index 000000000000..0be2a2e78a5d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredentialProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub BrowserCredential. + */ +@Fluent +public final class BrowserCredentialProperties { + /* + * Gets or sets web push subject. + */ + @JsonProperty(value = "subject") + private String subject; + + /* + * Gets or sets VAPID private key. + */ + @JsonProperty(value = "vapidPrivateKey") + private String vapidPrivateKey; + + /* + * Gets or sets VAPID public key. + */ + @JsonProperty(value = "vapidPublicKey") + private String vapidPublicKey; + + /** + * Creates an instance of BrowserCredentialProperties class. + */ + public BrowserCredentialProperties() { + } + + /** + * Get the subject property: Gets or sets web push subject. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Gets or sets web push subject. + * + * @param subject the subject value to set. + * @return the BrowserCredentialProperties object itself. + */ + public BrowserCredentialProperties withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the vapidPrivateKey property: Gets or sets VAPID private key. + * + * @return the vapidPrivateKey value. + */ + public String vapidPrivateKey() { + return this.vapidPrivateKey; + } + + /** + * Set the vapidPrivateKey property: Gets or sets VAPID private key. + * + * @param vapidPrivateKey the vapidPrivateKey value to set. + * @return the BrowserCredentialProperties object itself. + */ + public BrowserCredentialProperties withVapidPrivateKey(String vapidPrivateKey) { + this.vapidPrivateKey = vapidPrivateKey; + return this; + } + + /** + * Get the vapidPublicKey property: Gets or sets VAPID public key. + * + * @return the vapidPublicKey value. + */ + public String vapidPublicKey() { + return this.vapidPublicKey; + } + + /** + * Set the vapidPublicKey property: Gets or sets VAPID public key. + * + * @param vapidPublicKey the vapidPublicKey value to set. + * @return the BrowserCredentialProperties object itself. + */ + public BrowserCredentialProperties withVapidPublicKey(String vapidPublicKey) { + this.vapidPublicKey = vapidPublicKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subject() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property subject in model BrowserCredentialProperties")); + } + if (vapidPrivateKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property vapidPrivateKey in model BrowserCredentialProperties")); + } + if (vapidPublicKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property vapidPublicKey in model BrowserCredentialProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BrowserCredentialProperties.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityParameters.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityParameters.java index 4e52f753c560..cac2fe6c2837 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityParameters.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityParameters.java @@ -6,63 +6,68 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Parameters supplied to the Check Name Availability for Namespace and NotificationHubs. */ +/** + * Parameters supplied to the Check Name Availability for Namespace and + * NotificationHubs. + */ @Fluent public final class CheckAvailabilityParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckAvailabilityParameters.class); - /* - * Resource Id + * Gets resource Id */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* - * Resource name + * Gets or sets resource name */ @JsonProperty(value = "name", required = true) private String name; /* - * Resource type + * Gets resource type */ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* - * Resource location + * Gets or sets resource location */ @JsonProperty(value = "location") private String location; /* - * Resource tags + * Gets or sets resource tags */ @JsonProperty(value = "tags") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * The sku of the created namespace + * Not used and deprecated since API version 2023-01-01-preview + */ + @JsonProperty(value = "isAvailiable") + private Boolean isAvailiable; + + /* + * The Sku description for a namespace */ @JsonProperty(value = "sku") private Sku sku; - /* - * True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. + /** + * Creates an instance of CheckAvailabilityParameters class. */ - @JsonProperty(value = "isAvailiable") - private Boolean isAvailiable; + public CheckAvailabilityParameters() { + } /** - * Get the id property: Resource Id. - * + * Get the id property: Gets resource Id. + * * @return the id value. */ public String id() { @@ -70,8 +75,8 @@ public String id() { } /** - * Get the name property: Resource name. - * + * Get the name property: Gets or sets resource name. + * * @return the name value. */ public String name() { @@ -79,8 +84,8 @@ public String name() { } /** - * Set the name property: Resource name. - * + * Set the name property: Gets or sets resource name. + * * @param name the name value to set. * @return the CheckAvailabilityParameters object itself. */ @@ -90,8 +95,8 @@ public CheckAvailabilityParameters withName(String name) { } /** - * Get the type property: Resource type. - * + * Get the type property: Gets resource type. + * * @return the type value. */ public String type() { @@ -99,8 +104,8 @@ public String type() { } /** - * Get the location property: Resource location. - * + * Get the location property: Gets or sets resource location. + * * @return the location value. */ public String location() { @@ -108,8 +113,8 @@ public String location() { } /** - * Set the location property: Resource location. - * + * Set the location property: Gets or sets resource location. + * * @param location the location value to set. * @return the CheckAvailabilityParameters object itself. */ @@ -119,8 +124,8 @@ public CheckAvailabilityParameters withLocation(String location) { } /** - * Get the tags property: Resource tags. - * + * Get the tags property: Gets or sets resource tags. + * * @return the tags value. */ public Map tags() { @@ -128,8 +133,8 @@ public Map tags() { } /** - * Set the tags property: Resource tags. - * + * Set the tags property: Gets or sets resource tags. + * * @param tags the tags value to set. * @return the CheckAvailabilityParameters object itself. */ @@ -139,61 +144,59 @@ public CheckAvailabilityParameters withTags(Map tags) { } /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. + * Get the isAvailiable property: Not used and deprecated since API version 2023-01-01-preview. + * + * @return the isAvailiable value. */ - public Sku sku() { - return this.sku; + public Boolean isAvailiable() { + return this.isAvailiable; } /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. + * Set the isAvailiable property: Not used and deprecated since API version 2023-01-01-preview. + * + * @param isAvailiable the isAvailiable value to set. * @return the CheckAvailabilityParameters object itself. */ - public CheckAvailabilityParameters withSku(Sku sku) { - this.sku = sku; + public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { + this.isAvailiable = isAvailiable; return this; } /** - * Get the isAvailiable property: True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. - * - * @return the isAvailiable value. + * Get the sku property: The Sku description for a namespace. + * + * @return the sku value. */ - public Boolean isAvailiable() { - return this.isAvailiable; + public Sku sku() { + return this.sku; } /** - * Set the isAvailiable property: True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. - * - * @param isAvailiable the isAvailiable value to set. + * Set the sku property: The Sku description for a namespace. + * + * @param sku the sku value to set. * @return the CheckAvailabilityParameters object itself. */ - public CheckAvailabilityParameters withIsAvailiable(Boolean isAvailiable) { - this.isAvailiable = isAvailiable; + public CheckAvailabilityParameters withSku(Sku sku) { + this.sku = sku; 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 CheckAvailabilityParameters")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckAvailabilityParameters")); } if (sku() != null) { sku().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CheckAvailabilityParameters.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityResult.java index 4b5a1065dce7..de2080caa999 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityResult.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityResult.java @@ -4,64 +4,74 @@ package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import java.util.Map; -/** An immutable client-side representation of CheckAvailabilityResult. */ +/** + * An immutable client-side representation of CheckAvailabilityResult. + */ public interface CheckAvailabilityResult { /** * 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. - * + * Gets the isAvailiable property: Gets or sets true if the name is available and can be used to + * create new Namespace/NotificationHub. Otherwise false. + * + * @return the isAvailiable value. + */ + Boolean isAvailiable(); + + /** + * Gets the location property: Deprecated - only for compatibility. + * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. - * + * Gets the tags property: Deprecated - only for compatibility. + * * @return the tags value. */ Map tags(); /** - * Gets the isAvailiable property: True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. - * - * @return the isAvailiable value. + * Gets the sku property: The Sku description for a namespace. + * + * @return the sku value. */ - Boolean isAvailiable(); + Sku sku(); /** - * Gets the sku property: The sku of the created namespace. - * - * @return the sku value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - Sku sku(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner object. - * + * * @return the inner object. */ CheckAvailabilityResultInner innerModel(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResponse.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResponse.java index 781df439509d..449c1a6b6d60 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResponse.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResponse.java @@ -4,77 +4,66 @@ package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner; import java.util.Map; -/** An immutable client-side representation of DebugSendResponse. */ +/** + * An immutable client-side representation of DebugSendResponse. + */ public interface DebugSendResponse { /** * 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. - * + * Gets the properties property: Result of DebugSend operations. + * + * @return the properties value. + */ + DebugSendResult properties(); + + /** + * Gets the location property: Deprecated - only for compatibility. + * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. - * + * Gets the tags property: Deprecated - only for compatibility. + * * @return the tags value. */ Map tags(); /** - * Gets the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the success property: successful send. - * - * @return the success value. - */ - Float success(); - - /** - * Gets the failure property: send failure. - * - * @return the failure value. - */ - Float failure(); - - /** - * Gets the results property: actual failure description. - * - * @return the results value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - Object results(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner object. - * + * * @return the inner object. */ DebugSendResponseInner innerModel(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResult.java new file mode 100644 index 000000000000..7bf095ef2b13 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of DebugSend operations. + */ +@Immutable +public final class DebugSendResult { + /* + * Gets or sets successful send + */ + @JsonProperty(value = "success", access = JsonProperty.Access.WRITE_ONLY) + private Long success; + + /* + * Gets or sets send failure + */ + @JsonProperty(value = "failure", access = JsonProperty.Access.WRITE_ONLY) + private Long failure; + + /* + * Gets or sets actual failure description + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Creates an instance of DebugSendResult class. + */ + public DebugSendResult() { + } + + /** + * Get the success property: Gets or sets successful send. + * + * @return the success value. + */ + public Long success() { + return this.success; + } + + /** + * Get the failure property: Gets or sets send failure. + * + * @return the failure value. + */ + public Long failure() { + return this.failure; + } + + /** + * Get the results property: Gets or sets actual failure description. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (results() != null) { + results().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1Credential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1Credential.java new file mode 100644 index 000000000000..320c9274dc45 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1Credential.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub FcmV1Credential. + */ +@Fluent +public final class FcmV1Credential { + /* + * Description of a NotificationHub FcmV1Credential. + */ + @JsonProperty(value = "properties", required = true) + private FcmV1CredentialProperties properties; + + /** + * Creates an instance of FcmV1Credential class. + */ + public FcmV1Credential() { + } + + /** + * Get the properties property: Description of a NotificationHub FcmV1Credential. + * + * @return the properties value. + */ + public FcmV1CredentialProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Description of a NotificationHub FcmV1Credential. + * + * @param properties the properties value to set. + * @return the FcmV1Credential object itself. + */ + public FcmV1Credential withProperties(FcmV1CredentialProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model FcmV1Credential")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FcmV1Credential.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1CredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1CredentialProperties.java new file mode 100644 index 000000000000..8c0fd3cda1f5 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1CredentialProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub FcmV1Credential. + */ +@Fluent +public final class FcmV1CredentialProperties { + /* + * Gets or sets client email. + */ + @JsonProperty(value = "clientEmail") + private String clientEmail; + + /* + * Gets or sets private key. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Gets or sets project id. + */ + @JsonProperty(value = "projectId") + private String projectId; + + /** + * Creates an instance of FcmV1CredentialProperties class. + */ + public FcmV1CredentialProperties() { + } + + /** + * Get the clientEmail property: Gets or sets client email. + * + * @return the clientEmail value. + */ + public String clientEmail() { + return this.clientEmail; + } + + /** + * Set the clientEmail property: Gets or sets client email. + * + * @param clientEmail the clientEmail value to set. + * @return the FcmV1CredentialProperties object itself. + */ + public FcmV1CredentialProperties withClientEmail(String clientEmail) { + this.clientEmail = clientEmail; + return this; + } + + /** + * Get the privateKey property: Gets or sets private key. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Gets or sets private key. + * + * @param privateKey the privateKey value to set. + * @return the FcmV1CredentialProperties object itself. + */ + public FcmV1CredentialProperties withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the projectId property: Gets or sets project id. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Set the projectId property: Gets or sets project id. + * + * @param projectId the projectId value to set. + * @return the FcmV1CredentialProperties object itself. + */ + public FcmV1CredentialProperties withProjectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientEmail() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property clientEmail in model FcmV1CredentialProperties")); + } + if (privateKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property privateKey in model FcmV1CredentialProperties")); + } + if (projectId() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property projectId in model FcmV1CredentialProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FcmV1CredentialProperties.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredential.java index 7974d3ea2431..6d7a20108c99 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredential.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredential.java @@ -6,84 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.GcmCredentialProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub GcmCredential. */ +/** + * Description of a NotificationHub GcmCredential. + */ @Fluent public final class GcmCredential { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GcmCredential.class); - /* - * Properties of NotificationHub GcmCredential. - */ - @JsonProperty(value = "properties") - private GcmCredentialProperties innerProperties; - - /** - * Get the innerProperties property: Properties of NotificationHub GcmCredential. - * - * @return the innerProperties value. - */ - private GcmCredentialProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'. - * - * @return the gcmEndpoint value. + * Description of a NotificationHub GcmCredential. */ - public String gcmEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().gcmEndpoint(); - } + @JsonProperty(value = "properties", required = true) + private GcmCredentialProperties properties; /** - * Set the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'. - * - * @param gcmEndpoint the gcmEndpoint value to set. - * @return the GcmCredential object itself. + * Creates an instance of GcmCredential class. */ - public GcmCredential withGcmEndpoint(String gcmEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new GcmCredentialProperties(); - } - this.innerProperties().withGcmEndpoint(gcmEndpoint); - return this; + public GcmCredential() { } /** - * Get the googleApiKey property: The Google API key. - * - * @return the googleApiKey value. + * Get the properties property: Description of a NotificationHub GcmCredential. + * + * @return the properties value. */ - public String googleApiKey() { - return this.innerProperties() == null ? null : this.innerProperties().googleApiKey(); + public GcmCredentialProperties properties() { + return this.properties; } /** - * Set the googleApiKey property: The Google API key. - * - * @param googleApiKey the googleApiKey value to set. + * Set the properties property: Description of a NotificationHub GcmCredential. + * + * @param properties the properties value to set. * @return the GcmCredential object itself. */ - public GcmCredential withGoogleApiKey(String googleApiKey) { - if (this.innerProperties() == null) { - this.innerProperties = new GcmCredentialProperties(); - } - this.innerProperties().withGoogleApiKey(googleApiKey); + public GcmCredential withProperties(GcmCredentialProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model GcmCredential")); + } else { + properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(GcmCredential.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/GcmCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredentialProperties.java similarity index 61% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/GcmCredentialProperties.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredentialProperties.java index 545a4338761b..0bd4f4169a84 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/GcmCredentialProperties.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredentialProperties.java @@ -2,34 +2,38 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.notificationhubs.fluent.models; +package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub GcmCredential. */ +/** + * Description of a NotificationHub GcmCredential. + */ @Fluent public final class GcmCredentialProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GcmCredentialProperties.class); - /* - * The FCM legacy endpoint. Default value is - * 'https://fcm.googleapis.com/fcm/send' + * Gets or sets the GCM endpoint. */ @JsonProperty(value = "gcmEndpoint") private String gcmEndpoint; /* - * The Google API key. + * Gets or sets the Google API key. */ @JsonProperty(value = "googleApiKey") private String googleApiKey; /** - * Get the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'. - * + * Creates an instance of GcmCredentialProperties class. + */ + public GcmCredentialProperties() { + } + + /** + * Get the gcmEndpoint property: Gets or sets the GCM endpoint. + * * @return the gcmEndpoint value. */ public String gcmEndpoint() { @@ -37,8 +41,8 @@ public String gcmEndpoint() { } /** - * Set the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'. - * + * Set the gcmEndpoint property: Gets or sets the GCM endpoint. + * * @param gcmEndpoint the gcmEndpoint value to set. * @return the GcmCredentialProperties object itself. */ @@ -48,8 +52,8 @@ public GcmCredentialProperties withGcmEndpoint(String gcmEndpoint) { } /** - * Get the googleApiKey property: The Google API key. - * + * Get the googleApiKey property: Gets or sets the Google API key. + * * @return the googleApiKey value. */ public String googleApiKey() { @@ -57,8 +61,8 @@ public String googleApiKey() { } /** - * Set the googleApiKey property: The Google API key. - * + * Set the googleApiKey property: Gets or sets the Google API key. + * * @param googleApiKey the googleApiKey value to set. * @return the GcmCredentialProperties object itself. */ @@ -69,9 +73,15 @@ public GcmCredentialProperties withGoogleApiKey(String googleApiKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (googleApiKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property googleApiKey in model GcmCredentialProperties")); + } } + + private static final ClientLogger LOGGER = new ClientLogger(GcmCredentialProperties.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/IpRule.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/IpRule.java new file mode 100644 index 000000000000..213032752de7 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/IpRule.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A network authorization rule that filters traffic based on IP address. + */ +@Fluent +public final class IpRule { + /* + * IP mask. + */ + @JsonProperty(value = "ipMask", required = true) + private String ipMask; + + /* + * List of access rights. + */ + @JsonProperty(value = "rights", required = true) + private List rights; + + /** + * Creates an instance of IpRule class. + */ + public IpRule() { + } + + /** + * 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 IpRule object itself. + */ + public IpRule withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get the rights property: List of access rights. + * + * @return the rights value. + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights property: List of access rights. + * + * @param rights the rights value to set. + * @return the IpRule object itself. + */ + public IpRule withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipMask() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property ipMask in model IpRule")); + } + if (rights() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property rights in model IpRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/LogSpecification.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/LogSpecification.java new file mode 100644 index 000000000000..7671c04a9e64 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/LogSpecification.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A single log category specification. + */ +@Fluent +public final class LogSpecification { + /* + * Name of the log category. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Display name of the log category. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Duration of data written to a single blob. + */ + @JsonProperty(value = "blobDuration", access = JsonProperty.Access.WRITE_ONLY) + private String blobDuration; + + /* + * Category group for the log specification. + */ + @JsonProperty(value = "categoryGroups") + private List categoryGroups; + + /** + * Creates an instance of LogSpecification class. + */ + public LogSpecification() { + } + + /** + * Get the name property: Name of the log category. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Display name of the log category. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the blobDuration property: Duration of data written to a single blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Get the categoryGroups property: Category group for the log specification. + * + * @return the categoryGroups value. + */ + public List categoryGroups() { + return this.categoryGroups; + } + + /** + * Set the categoryGroups property: Category group for the log specification. + * + * @param categoryGroups the categoryGroups value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withCategoryGroups(List categoryGroups) { + this.categoryGroups = categoryGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MetricSpecification.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MetricSpecification.java new file mode 100644 index 000000000000..561adaaee729 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MetricSpecification.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.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A metric specification. + */ +@Immutable +public final class MetricSpecification { + /* + * Metric name / id. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * User-visible metric name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Description of the metric. + */ + @JsonProperty(value = "displayDescription", access = JsonProperty.Access.WRITE_ONLY) + private String displayDescription; + + /* + * Metric unit. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /* + * Type of the aggregation (Average, Minimum, Maximum, Total or Count). + */ + @JsonProperty(value = "aggregationType", access = JsonProperty.Access.WRITE_ONLY) + private String aggregationType; + + /* + * List of availabilities. + */ + @JsonProperty(value = "availabilities", access = JsonProperty.Access.WRITE_ONLY) + private List availabilities; + + /* + * List of supported time grain types. + */ + @JsonProperty(value = "supportedTimeGrainTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedTimeGrainTypes; + + /* + * The matching regex pattern to be applied to the field pointed by the "metricsFilterPathSelector" flag in the ARM + * manifest. + */ + @JsonProperty(value = "metricFilterPattern", access = JsonProperty.Access.WRITE_ONLY) + private String metricFilterPattern; + + /* + * Optional property. If set to true, then zero will be returned for time duration where no metric is emitted / + * published. + */ + @JsonProperty(value = "fillGapWithZero", access = JsonProperty.Access.WRITE_ONLY) + private Boolean fillGapWithZero; + + /** + * Creates an instance of MetricSpecification class. + */ + public MetricSpecification() { + } + + /** + * Get the name property: Metric name / id. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: User-visible metric name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the displayDescription property: Description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Get the unit property: Metric unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the aggregationType property: Type of the aggregation (Average, Minimum, Maximum, Total or Count). + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Get the availabilities property: List of availabilities. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Get the supportedTimeGrainTypes property: List of supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Get the metricFilterPattern property: The matching regex pattern to be applied to the field pointed by the + * "metricsFilterPathSelector" flag in the ARM manifest. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Get the fillGapWithZero property: Optional property. If set to true, then zero will be returned for time + * duration where no metric is emitted / published. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredential.java index 368884a11e7e..779bf792db5d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredential.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredential.java @@ -6,107 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.MpnsCredentialProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub MpnsCredential. */ +/** + * Description of a NotificationHub MpnsCredential. + */ @Fluent public final class MpnsCredential { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MpnsCredential.class); - /* - * Properties of NotificationHub MpnsCredential. + * Description of a NotificationHub MpnsCredential. */ - @JsonProperty(value = "properties") - private MpnsCredentialProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private MpnsCredentialProperties properties; /** - * Get the innerProperties property: Properties of NotificationHub MpnsCredential. - * - * @return the innerProperties value. + * Creates an instance of MpnsCredential class. */ - private MpnsCredentialProperties innerProperties() { - return this.innerProperties; + public MpnsCredential() { } /** - * Get the mpnsCertificate property: The MPNS certificate. - * - * @return the mpnsCertificate value. + * Get the properties property: Description of a NotificationHub MpnsCredential. + * + * @return the properties value. */ - public String mpnsCertificate() { - return this.innerProperties() == null ? null : this.innerProperties().mpnsCertificate(); + public MpnsCredentialProperties properties() { + return this.properties; } /** - * Set the mpnsCertificate property: The MPNS certificate. - * - * @param mpnsCertificate the mpnsCertificate value to set. + * Set the properties property: Description of a NotificationHub MpnsCredential. + * + * @param properties the properties value to set. * @return the MpnsCredential object itself. */ - public MpnsCredential withMpnsCertificate(String mpnsCertificate) { - if (this.innerProperties() == null) { - this.innerProperties = new MpnsCredentialProperties(); - } - this.innerProperties().withMpnsCertificate(mpnsCertificate); - return this; - } - - /** - * Get the certificateKey property: The certificate key for this credential. - * - * @return the certificateKey value. - */ - public String certificateKey() { - return this.innerProperties() == null ? null : this.innerProperties().certificateKey(); - } - - /** - * Set the certificateKey property: The certificate key for this credential. - * - * @param certificateKey the certificateKey value to set. - * @return the MpnsCredential object itself. - */ - public MpnsCredential withCertificateKey(String certificateKey) { - if (this.innerProperties() == null) { - this.innerProperties = new MpnsCredentialProperties(); - } - this.innerProperties().withCertificateKey(certificateKey); - return this; - } - - /** - * Get the thumbprint property: The MPNS certificate Thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); - } - - /** - * Set the thumbprint property: The MPNS certificate Thumbprint. - * - * @param thumbprint the thumbprint value to set. - * @return the MpnsCredential object itself. - */ - public MpnsCredential withThumbprint(String thumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new MpnsCredentialProperties(); - } - this.innerProperties().withThumbprint(thumbprint); + public MpnsCredential withProperties(MpnsCredentialProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model MpnsCredential")); + } else { + properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(MpnsCredential.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/MpnsCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredentialProperties.java similarity index 54% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/MpnsCredentialProperties.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredentialProperties.java index 7caace3ebf7f..b855d624af06 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/MpnsCredentialProperties.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredentialProperties.java @@ -2,39 +2,44 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.notificationhubs.fluent.models; +package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub MpnsCredential. */ +/** + * Description of a NotificationHub MpnsCredential. + */ @Fluent public final class MpnsCredentialProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MpnsCredentialProperties.class); - /* - * The MPNS certificate. + * Gets or sets the MPNS certificate. */ @JsonProperty(value = "mpnsCertificate") private String mpnsCertificate; /* - * The certificate key for this credential. + * Gets or sets the certificate key for this credential. */ @JsonProperty(value = "certificateKey") private String certificateKey; /* - * The MPNS certificate Thumbprint + * Gets or sets the MPNS certificate Thumbprint */ @JsonProperty(value = "thumbprint") private String thumbprint; /** - * Get the mpnsCertificate property: The MPNS certificate. - * + * Creates an instance of MpnsCredentialProperties class. + */ + public MpnsCredentialProperties() { + } + + /** + * Get the mpnsCertificate property: Gets or sets the MPNS certificate. + * * @return the mpnsCertificate value. */ public String mpnsCertificate() { @@ -42,8 +47,8 @@ public String mpnsCertificate() { } /** - * Set the mpnsCertificate property: The MPNS certificate. - * + * Set the mpnsCertificate property: Gets or sets the MPNS certificate. + * * @param mpnsCertificate the mpnsCertificate value to set. * @return the MpnsCredentialProperties object itself. */ @@ -53,8 +58,8 @@ public MpnsCredentialProperties withMpnsCertificate(String mpnsCertificate) { } /** - * Get the certificateKey property: The certificate key for this credential. - * + * Get the certificateKey property: Gets or sets the certificate key for this credential. + * * @return the certificateKey value. */ public String certificateKey() { @@ -62,8 +67,8 @@ public String certificateKey() { } /** - * Set the certificateKey property: The certificate key for this credential. - * + * Set the certificateKey property: Gets or sets the certificate key for this credential. + * * @param certificateKey the certificateKey value to set. * @return the MpnsCredentialProperties object itself. */ @@ -73,8 +78,8 @@ public MpnsCredentialProperties withCertificateKey(String certificateKey) { } /** - * Get the thumbprint property: The MPNS certificate Thumbprint. - * + * Get the thumbprint property: Gets or sets the MPNS certificate Thumbprint. + * * @return the thumbprint value. */ public String thumbprint() { @@ -82,8 +87,8 @@ public String thumbprint() { } /** - * Set the thumbprint property: The MPNS certificate Thumbprint. - * + * Set the thumbprint property: Gets or sets the MPNS certificate Thumbprint. + * * @param thumbprint the thumbprint value to set. * @return the MpnsCredentialProperties object itself. */ @@ -94,9 +99,23 @@ public MpnsCredentialProperties withThumbprint(String thumbprint) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (mpnsCertificate() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property mpnsCertificate in model MpnsCredentialProperties")); + } + if (certificateKey() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property certificateKey in model MpnsCredentialProperties")); + } + if (thumbprint() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property thumbprint in model MpnsCredentialProperties")); + } } + + private static final ClientLogger LOGGER = new ClientLogger(MpnsCredentialProperties.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceCreateOrUpdateParameters.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceCreateOrUpdateParameters.java deleted file mode 100644 index f35bedb0b4bf..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceCreateOrUpdateParameters.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Parameters supplied to the CreateOrUpdate Namespace operation. */ -@Fluent -public final class NamespaceCreateOrUpdateParameters extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespaceCreateOrUpdateParameters.class); - - /* - * Properties of the Namespace. - */ - @JsonProperty(value = "properties") - private NamespaceProperties innerProperties; - - /* - * The sku of the created namespace - */ - @JsonProperty(value = "sku") - private Sku sku; - - /** - * Get the innerProperties property: Properties of the Namespace. - * - * @return the innerProperties value. - */ - private NamespaceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public NamespaceCreateOrUpdateParameters withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NamespaceCreateOrUpdateParameters withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the name property: The name of the namespace. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: The name of the namespace. - * - * @param name the name value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withName(name); - 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(); - } - - /** - * Set the provisioningState property: Provisioning state of the Namespace. - * - * @param provisioningState the provisioningState value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withProvisioningState(String provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the region property: Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central - * US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe. - * - * @return the region value. - */ - public String region() { - return this.innerProperties() == null ? null : this.innerProperties().region(); - } - - /** - * Set the region property: Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North Central - * US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe. - * - * @param region the region value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withRegion(String region) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withRegion(region); - return this; - } - - /** - * Get the metricId property: Identifier for Azure Insights metrics. - * - * @return the metricId value. - */ - public String metricId() { - return this.innerProperties() == null ? null : this.innerProperties().metricId(); - } - - /** - * Get the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * - * @param status the status value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withStatus(String status) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * 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(); - } - - /** - * Set the createdAt property: The time the namespace was created. - * - * @param createdAt the createdAt value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withCreatedAt(OffsetDateTime createdAt) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withCreatedAt(createdAt); - return this; - } - - /** - * 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(); - } - - /** - * Set the updatedAt property: The time the namespace was updated. - * - * @param updatedAt the updatedAt value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withUpdatedAt(OffsetDateTime updatedAt) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withUpdatedAt(updatedAt); - return this; - } - - /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. - * - * @return the serviceBusEndpoint value. - */ - public String serviceBusEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); - } - - /** - * Set the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. - * - * @param serviceBusEndpoint the serviceBusEndpoint value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withServiceBusEndpoint(String serviceBusEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withServiceBusEndpoint(serviceBusEndpoint); - return this; - } - - /** - * Get the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Set the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @param subscriptionId the subscriptionId value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withSubscriptionId(String subscriptionId) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withSubscriptionId(subscriptionId); - return this; - } - - /** - * Get the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @return the scaleUnit value. - */ - public String scaleUnit() { - return this.innerProperties() == null ? null : this.innerProperties().scaleUnit(); - } - - /** - * Set the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @param scaleUnit the scaleUnit value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withScaleUnit(String scaleUnit) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withScaleUnit(scaleUnit); - return this; - } - - /** - * Get the enabled property: Whether or not the namespace is currently enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Whether or not the namespace is currently enabled. - * - * @param enabled the enabled value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Get the critical property: Whether or not the namespace is set as Critical. - * - * @return the critical value. - */ - public Boolean critical() { - return this.innerProperties() == null ? null : this.innerProperties().critical(); - } - - /** - * Set the critical property: Whether or not the namespace is set as Critical. - * - * @param critical the critical value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withCritical(Boolean critical) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withCritical(critical); - return this; - } - - /** - * Get the dataCenter property: Data center for the namespace. - * - * @return the dataCenter value. - */ - public String dataCenter() { - return this.innerProperties() == null ? null : this.innerProperties().dataCenter(); - } - - /** - * Set the dataCenter property: Data center for the namespace. - * - * @param dataCenter the dataCenter value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withDataCenter(String dataCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withDataCenter(dataCenter); - return this; - } - - /** - * Get the namespaceType property: The namespace type. - * - * @return the namespaceType value. - */ - public NamespaceType namespaceType() { - return this.innerProperties() == null ? null : this.innerProperties().namespaceType(); - } - - /** - * Set the namespaceType property: The namespace type. - * - * @param namespaceType the namespaceType value to set. - * @return the NamespaceCreateOrUpdateParameters object itself. - */ - public NamespaceCreateOrUpdateParameters withNamespaceType(NamespaceType namespaceType) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withNamespaceType(namespaceType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceListResult.java index c32c94d14e52..cd7f5ec58d7c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceListResult.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceListResult.java @@ -4,76 +4,55 @@ package com.azure.resourcemanager.notificationhubs.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of the List Namespace operation. */ -@Fluent +/** + * The response of the List Namespace operation. + */ +@Immutable public final class NamespaceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespaceListResult.class); - /* - * Result of the List Namespace operation. + * Gets or sets result of the List AuthorizationRules operation. */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of Namespaces + * Gets or sets link to the next set of results. */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: Result of the List Namespace operation. - * - * @return the value value. + * Creates an instance of NamespaceListResult class. */ - public List value() { - return this.value; + public NamespaceListResult() { } /** - * Set the value property: Result of the List Namespace operation. - * - * @param value the value value to set. - * @return the NamespaceListResult object itself. + * Get the value property: Gets or sets result of the List AuthorizationRules operation. + * + * @return the value value. */ - public NamespaceListResult withValue(List value) { - this.value = value; - return this; + public List value() { + return this.value; } /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Namespaces. - * + * Get the nextLink property: Gets or sets link to the next set of results. + * * @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 NamespaceListResult object itself. - */ - public NamespaceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespacePatchParameters.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespacePatchParameters.java index 63420a968671..5ca4ad67effc 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespacePatchParameters.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespacePatchParameters.java @@ -5,78 +5,111 @@ package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Parameters supplied to the Patch Namespace operation. */ +/** + * Patch parameter for NamespaceResource. + */ @Fluent public final class NamespacePatchParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespacePatchParameters.class); + /* + * The Sku description for a namespace + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Represents namespace properties. + */ + @JsonProperty(value = "properties") + private NamespaceProperties properties; /* - * Resource tags + * Dictionary of */ @JsonProperty(value = "tags") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The sku of the created namespace + /** + * Creates an instance of NamespacePatchParameters class. */ - @JsonProperty(value = "sku") - private Sku sku; + public NamespacePatchParameters() { + } /** - * Get the tags property: Resource tags. - * - * @return the tags value. + * Get the sku property: The Sku description for a namespace. + * + * @return the sku value. */ - public Map tags() { - return this.tags; + public Sku sku() { + return this.sku; } /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. + * Set the sku property: The Sku description for a namespace. + * + * @param sku the sku value to set. * @return the NamespacePatchParameters object itself. */ - public NamespacePatchParameters withTags(Map tags) { - this.tags = tags; + public NamespacePatchParameters withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. + * Get the properties property: Represents namespace properties. + * + * @return the properties value. */ - public Sku sku() { - return this.sku; + public NamespaceProperties properties() { + return this.properties; } /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. + * Set the properties property: Represents namespace properties. + * + * @param properties the properties value to set. * @return the NamespacePatchParameters object itself. */ - public NamespacePatchParameters withSku(Sku sku) { - this.sku = sku; + public NamespacePatchParameters withProperties(NamespaceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the NamespacePatchParameters object itself. + */ + public NamespacePatchParameters withTags(Map tags) { + this.tags = tags; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (sku() != null) { sku().validate(); } + if (properties() != null) { + properties().validate(); + } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceProperties.java new file mode 100644 index 000000000000..e6d3ba25677a --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceProperties.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Represents namespace properties. + */ +@Fluent +public final class NamespaceProperties { + /* + * Name of the Notification Hubs namespace. This is immutable property, set automatically + * by the service when the namespace is created. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Defines values for OperationProvisioningState. + */ + @JsonProperty(value = "provisioningState") + private OperationProvisioningState provisioningState; + + /* + * Namespace status. + */ + @JsonProperty(value = "status") + private NamespaceStatus status; + + /* + * Gets or sets whether or not the namespace is currently enabled. + */ + @JsonProperty(value = "enabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enabled; + + /* + * Gets or sets whether or not the namespace is set as Critical. + */ + @JsonProperty(value = "critical", access = JsonProperty.Access.WRITE_ONLY) + private Boolean critical; + + /* + * Namespace subscription id. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * Region. The value is always set to the same value as Namespace.Location, so we are deprecating + * this property. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * Azure Insights Metrics id. + */ + @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /* + * Time when the namespace was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * Time when the namespace was updated. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Defines values for NamespaceType. + */ + @JsonProperty(value = "namespaceType") + private NamespaceType namespaceType; + + /* + * Allowed replication region + */ + @JsonProperty(value = "replicationRegion") + private ReplicationRegion replicationRegion; + + /* + * Namespace SKU name. + */ + @JsonProperty(value = "zoneRedundancy") + private ZoneRedundancyPreference zoneRedundancy; + + /* + * A collection of network authorization rules. + */ + @JsonProperty(value = "networkAcls") + private NetworkAcls networkAcls; + + /* + * Collection of Notification Hub or Notification Hub Namespace PNS credentials. + */ + @JsonProperty(value = "pnsCredentials") + private PnsCredentials pnsCredentials; + + /* + * Gets or sets endpoint you can use to perform NotificationHub + * operations. + */ + @JsonProperty(value = "serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceBusEndpoint; + + /* + * Private Endpoint Connections for namespace + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Gets or sets scaleUnit where the namespace gets created + */ + @JsonProperty(value = "scaleUnit") + private String scaleUnit; + + /* + * Deprecated. + */ + @JsonProperty(value = "dataCenter") + private String dataCenter; + + /* + * Type of public network access. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Creates an instance of NamespaceProperties class. + */ + public NamespaceProperties() { + } + + /** + * Get the name property: Name of the Notification Hubs namespace. This is immutable property, set automatically + * by the service when the namespace is created. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the provisioningState property: Defines values for OperationProvisioningState. + * + * @return the provisioningState value. + */ + public OperationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Defines values for OperationProvisioningState. + * + * @param provisioningState the provisioningState value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withProvisioningState(OperationProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the status property: Namespace status. + * + * @return the status value. + */ + public NamespaceStatus status() { + return this.status; + } + + /** + * Set the status property: Namespace status. + * + * @param status the status value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withStatus(NamespaceStatus status) { + this.status = status; + return this; + } + + /** + * Get the enabled property: Gets or sets whether or not the namespace is currently enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Get the critical property: Gets or sets whether or not the namespace is set as Critical. + * + * @return the critical value. + */ + public Boolean critical() { + return this.critical; + } + + /** + * Get the subscriptionId property: Namespace subscription id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the region property: Region. The value is always set to the same value as Namespace.Location, so we are + * deprecating + * this property. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the metricId property: Azure Insights Metrics id. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * Get the createdAt property: Time when the namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Time when the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the namespaceType property: Defines values for NamespaceType. + * + * @return the namespaceType value. + */ + public NamespaceType namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespaceType property: Defines values for NamespaceType. + * + * @param namespaceType the namespaceType value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the replicationRegion property: Allowed replication region. + * + * @return the replicationRegion value. + */ + public ReplicationRegion replicationRegion() { + return this.replicationRegion; + } + + /** + * Set the replicationRegion property: Allowed replication region. + * + * @param replicationRegion the replicationRegion value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withReplicationRegion(ReplicationRegion replicationRegion) { + this.replicationRegion = replicationRegion; + return this; + } + + /** + * Get the zoneRedundancy property: Namespace SKU name. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancyPreference zoneRedundancy() { + return this.zoneRedundancy; + } + + /** + * Set the zoneRedundancy property: Namespace SKU name. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withZoneRedundancy(ZoneRedundancyPreference zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; + return this; + } + + /** + * Get the networkAcls property: A collection of network authorization rules. + * + * @return the networkAcls value. + */ + public NetworkAcls networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: A collection of network authorization rules. + * + * @param networkAcls the networkAcls value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withNetworkAcls(NetworkAcls networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Get the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. + * + * @return the pnsCredentials value. + */ + public PnsCredentials pnsCredentials() { + return this.pnsCredentials; + } + + /** + * Set the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. + * + * @param pnsCredentials the pnsCredentials value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withPnsCredentials(PnsCredentials pnsCredentials) { + this.pnsCredentials = pnsCredentials; + return this; + } + + /** + * Get the serviceBusEndpoint property: Gets or sets endpoint you can use to perform NotificationHub + * operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Get the privateEndpointConnections property: Private Endpoint Connections for namespace. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. + * + * @return the scaleUnit value. + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Set the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Get the dataCenter property: Deprecated. + * + * @return the dataCenter value. + */ + public String dataCenter() { + return this.dataCenter; + } + + /** + * Set the dataCenter property: Deprecated. + * + * @param dataCenter the dataCenter value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withDataCenter(String dataCenter) { + this.dataCenter = dataCenter; + return this; + } + + /** + * Get the publicNetworkAccess property: Type of public network access. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Type of public network access. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NamespaceProperties object itself. + */ + public NamespaceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkAcls() != null) { + networkAcls().validate(); + } + if (pnsCredentials() != null) { + pnsCredentials().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceResource.java index efe1c33c9e3a..126b318468bb 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceResource.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceResource.java @@ -4,458 +4,316 @@ package com.azure.resourcemanager.notificationhubs.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.notificationhubs.fluent.models.NamespaceResourceInner; -import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of NamespaceResource. */ +/** + * An immutable client-side representation of NamespaceResource. + */ public interface NamespaceResource { /** * 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: The sku of the created namespace. - * + * Gets the sku property: The Sku description for a namespace. + * * @return the sku value. */ Sku sku(); /** - * Gets the namePropertiesName property: The name of the namespace. - * - * @return the namePropertiesName value. + * Gets the properties property: Represents namespace properties. + * + * @return the properties value. */ - String namePropertiesName(); + NamespaceProperties properties(); /** - * Gets the provisioningState property: Provisioning state of the Namespace. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** - * Gets the region property: Specifies the targeted region in which the namespace should be created. It can be any - * of the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, North - * Central US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West - * Europe. - * - * @return the region value. + * Gets the region of the resource. + * + * @return the region of the resource. */ - String region(); + Region region(); /** - * Gets the metricId property: Identifier for Azure Insights metrics. - * - * @return the metricId value. + * Gets the name of the resource region. + * + * @return the name of the resource region. */ - String metricId(); + String regionName(); /** - * Gets the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 - * = Suspended4 = Deleting. - * - * @return the status value. + * Gets the name of the resource group. + * + * @return the name of the resource group. */ - String status(); + String resourceGroupName(); /** - * 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 NotificationHub operations. - * - * @return the serviceBusEndpoint value. - */ - String serviceBusEndpoint(); - - /** - * Gets the subscriptionId property: The Id of the Azure subscription associated with the namespace. - * - * @return the subscriptionId value. - */ - String subscriptionId(); - - /** - * Gets the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @return the scaleUnit value. - */ - String scaleUnit(); - - /** - * Gets the enabled property: Whether or not the namespace is currently enabled. - * - * @return the enabled value. - */ - Boolean enabled(); - - /** - * Gets the critical property: Whether or not the namespace is set as Critical. - * - * @return the critical value. + * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner object. + * + * @return the inner object. */ - Boolean critical(); + NamespaceResourceInner innerModel(); /** - * Gets the dataCenter property: Data center for the namespace. - * - * @return the dataCenter value. + * The entirety of the NamespaceResource definition. */ - String dataCenter(); + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } /** - * Gets the namespaceType property: The namespace type. - * - * @return the namespaceType value. + * The NamespaceResource definition stages. */ - NamespaceType namespaceType(); - - /** - * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner object. - * - * @return the inner object. - */ - NamespaceResourceInner innerModel(); - - /** The entirety of the NamespaceResource definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The NamespaceResource definition stages. */ interface DefinitionStages { - /** The first stage of the NamespaceResource definition. */ + /** + * The first stage of the NamespaceResource definition. + */ interface Blank extends WithLocation { } - /** The stage of the NamespaceResource definition allowing to specify location. */ + + /** + * The stage of the NamespaceResource 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 withLocation(Region location); + 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 withLocation(String location); + WithResourceGroup withRegion(String location); } - /** The stage of the NamespaceResource definition allowing to specify parent resource. */ + + /** + * The stage of the NamespaceResource definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithCreate withExistingResourceGroup(String resourceGroupName); + WithSku withExistingResourceGroup(String resourceGroupName); } + + /** + * The stage of the NamespaceResource definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The Sku description for a namespace. + * + * @param sku The Sku description for a namespace. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** * The stage of the NamespaceResource 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.WithNamePropertiesName, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithRegion, - DefinitionStages.WithStatus, - DefinitionStages.WithCreatedAt, - DefinitionStages.WithUpdatedAt, - DefinitionStages.WithServiceBusEndpoint, - DefinitionStages.WithSubscriptionId, - DefinitionStages.WithScaleUnit, - DefinitionStages.WithEnabled, - DefinitionStages.WithCritical, - DefinitionStages.WithDataCenter, - DefinitionStages.WithNamespaceType { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ NamespaceResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ NamespaceResource create(Context context); } - /** The stage of the NamespaceResource definition allowing to specify tags. */ + + /** + * The stage of the NamespaceResource 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 NamespaceResource definition allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku property: The sku of the created namespace. - * - * @param sku The sku of the created namespace. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - /** The stage of the NamespaceResource definition allowing to specify namePropertiesName. */ - interface WithNamePropertiesName { - /** - * Specifies the namePropertiesName property: The name of the namespace.. - * - * @param namePropertiesName The name of the namespace. - * @return the next definition stage. - */ - WithCreate withNamePropertiesName(String namePropertiesName); - } - /** The stage of the NamespaceResource definition allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: Provisioning state of the Namespace.. - * - * @param provisioningState Provisioning state of the Namespace. - * @return the next definition stage. - */ - WithCreate withProvisioningState(String provisioningState); - } - /** The stage of the NamespaceResource definition allowing to specify region. */ - interface WithRegion { - /** - * Specifies the region property: Specifies the targeted region in which the namespace should be created. It - * can be any of the following values: Australia East, Australia Southeast, Central US, East US, East US 2, - * West US, North Central US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan - * West, North Europe, West Europe. - * - * @param region Specifies the targeted region in which the namespace should be created. It can be any of - * the following values: Australia East, Australia Southeast, Central US, East US, East US 2, West US, - * North Central US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, - * North Europe, West Europe. - * @return the next definition stage. - */ - WithCreate withRegion(String region); - } - /** The stage of the NamespaceResource definition allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 - * = Creating3 = Suspended4 = Deleting. - * - * @param status Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. - * @return the next definition stage. - */ - WithCreate withStatus(String status); - } - /** The stage of the NamespaceResource definition allowing to specify createdAt. */ - interface WithCreatedAt { - /** - * Specifies the createdAt property: The time the namespace was created.. - * - * @param createdAt The time the namespace was created. - * @return the next definition stage. - */ - WithCreate withCreatedAt(OffsetDateTime createdAt); - } - /** The stage of the NamespaceResource definition allowing to specify updatedAt. */ - interface WithUpdatedAt { - /** - * Specifies the updatedAt property: The time the namespace was updated.. - * - * @param updatedAt The time the namespace was updated. - * @return the next definition stage. - */ - WithCreate withUpdatedAt(OffsetDateTime updatedAt); - } - /** The stage of the NamespaceResource definition allowing to specify serviceBusEndpoint. */ - interface WithServiceBusEndpoint { - /** - * Specifies the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations.. - * - * @param serviceBusEndpoint Endpoint you can use to perform NotificationHub operations. - * @return the next definition stage. - */ - WithCreate withServiceBusEndpoint(String serviceBusEndpoint); - } - /** The stage of the NamespaceResource definition allowing to specify subscriptionId. */ - interface WithSubscriptionId { - /** - * Specifies the subscriptionId property: The Id of the Azure subscription associated with the namespace.. - * - * @param subscriptionId The Id of the Azure subscription associated with the namespace. - * @return the next definition stage. - */ - WithCreate withSubscriptionId(String subscriptionId); - } - /** The stage of the NamespaceResource definition allowing to specify scaleUnit. */ - interface WithScaleUnit { - /** - * Specifies the scaleUnit property: ScaleUnit where the namespace gets created. - * - * @param scaleUnit ScaleUnit where the namespace gets created. - * @return the next definition stage. - */ - WithCreate withScaleUnit(String scaleUnit); - } - /** The stage of the NamespaceResource definition allowing to specify enabled. */ - interface WithEnabled { - /** - * Specifies the enabled property: Whether or not the namespace is currently enabled.. - * - * @param enabled Whether or not the namespace is currently enabled. - * @return the next definition stage. - */ - WithCreate withEnabled(Boolean enabled); - } - /** The stage of the NamespaceResource definition allowing to specify critical. */ - interface WithCritical { - /** - * Specifies the critical property: Whether or not the namespace is set as Critical.. - * - * @param critical Whether or not the namespace is set as Critical. - * @return the next definition stage. - */ - WithCreate withCritical(Boolean critical); - } - /** The stage of the NamespaceResource definition allowing to specify dataCenter. */ - interface WithDataCenter { - /** - * Specifies the dataCenter property: Data center for the namespace. - * - * @param dataCenter Data center for the namespace. - * @return the next definition stage. - */ - WithCreate withDataCenter(String dataCenter); - } - /** The stage of the NamespaceResource definition allowing to specify namespaceType. */ - interface WithNamespaceType { + + /** + * The stage of the NamespaceResource definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the namespaceType property: The namespace type.. - * - * @param namespaceType The namespace type. + * Specifies the properties property: Represents namespace properties.. + * + * @param properties Represents namespace properties. * @return the next definition stage. */ - WithCreate withNamespaceType(NamespaceType namespaceType); + WithCreate withProperties(NamespaceProperties properties); } } + /** * Begins update for the NamespaceResource resource. - * + * * @return the stage of resource update. */ NamespaceResource.Update update(); - /** The template for NamespaceResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + /** + * The template for NamespaceResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ NamespaceResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ NamespaceResource apply(Context context); } - /** The NamespaceResource update stages. */ + + /** + * The NamespaceResource update stages. + */ interface UpdateStages { - /** The stage of the NamespaceResource update allowing to specify tags. */ + /** + * The stage of the NamespaceResource update allowing to specify tags. + */ interface WithTags { /** - * Specifies the tags property: Resource tags. - * - * @param tags Resource tags. + * Specifies the tags property: Dictionary of <string>. + * + * @param tags Dictionary of <string>. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the NamespaceResource update allowing to specify sku. */ + + /** + * The stage of the NamespaceResource update allowing to specify sku. + */ interface WithSku { /** - * Specifies the sku property: The sku of the created namespace. - * - * @param sku The sku of the created namespace. + * Specifies the sku property: The Sku description for a namespace. + * + * @param sku The Sku description for a namespace. * @return the next definition stage. */ Update withSku(Sku sku); } + + /** + * The stage of the NamespaceResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Represents namespace properties.. + * + * @param properties Represents namespace properties. + * @return the next definition stage. + */ + Update withProperties(NamespaceProperties properties); + } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ NamespaceResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ NamespaceResource refresh(Context context); + + /** + * Lists the PNS credentials associated with a 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 description of a NotificationHub PNS Credentials along with {@link Response}. + */ + Response getPnsCredentialsWithResponse(Context context); + + /** + * Lists the PNS credentials associated with a 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 description of a NotificationHub PNS Credentials. + */ + PnsCredentialsResource getPnsCredentials(); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceStatus.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceStatus.java new file mode 100644 index 000000000000..58acaf2aa917 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceStatus.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.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Namespace status. + */ +public final class NamespaceStatus extends ExpandableStringEnum { + /** + * Static value Created for NamespaceStatus. + */ + public static final NamespaceStatus CREATED = fromString("Created"); + + /** + * Static value Creating for NamespaceStatus. + */ + public static final NamespaceStatus CREATING = fromString("Creating"); + + /** + * Static value Suspended for NamespaceStatus. + */ + public static final NamespaceStatus SUSPENDED = fromString("Suspended"); + + /** + * Static value Deleting for NamespaceStatus. + */ + public static final NamespaceStatus DELETING = fromString("Deleting"); + + /** + * Creates a new instance of NamespaceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NamespaceStatus() { + } + + /** + * Creates or finds a NamespaceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NamespaceStatus. + */ + @JsonCreator + public static NamespaceStatus fromString(String name) { + return fromString(name, NamespaceStatus.class); + } + + /** + * Gets known NamespaceStatus values. + * + * @return known NamespaceStatus values. + */ + public static Collection values() { + return values(NamespaceStatus.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceType.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceType.java index 608989fde35f..8255c95a00ee 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceType.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceType.java @@ -4,44 +4,50 @@ package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; -/** Defines values for NamespaceType. */ -public enum NamespaceType { - /** Enum value Messaging. */ - MESSAGING("Messaging"), - - /** Enum value NotificationHub. */ - NOTIFICATION_HUB("NotificationHub"); +/** + * Defines values for NamespaceType. + */ +public final class NamespaceType extends ExpandableStringEnum { + /** + * Static value Messaging for NamespaceType. + */ + public static final NamespaceType MESSAGING = fromString("Messaging"); - /** The actual serialized value for a NamespaceType instance. */ - private final String value; + /** + * Static value NotificationHub for NamespaceType. + */ + public static final NamespaceType NOTIFICATION_HUB = fromString("NotificationHub"); - NamespaceType(String value) { - this.value = value; + /** + * Creates a new instance of NamespaceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NamespaceType() { } /** - * Parses a serialized value to a NamespaceType instance. - * - * @param value the serialized value to parse. - * @return the parsed NamespaceType object, or null if unable to parse. + * Creates or finds a NamespaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NamespaceType. */ @JsonCreator - public static NamespaceType fromString(String value) { - NamespaceType[] items = NamespaceType.values(); - for (NamespaceType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static NamespaceType fromString(String name) { + return fromString(name, NamespaceType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known NamespaceType values. + * + * @return known NamespaceType values. + */ + public static Collection values() { + return values(NamespaceType.class); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Namespaces.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Namespaces.java index 5a8e18fba0b9..b791e1d65515 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Namespaces.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Namespaces.java @@ -7,377 +7,387 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; -/** Resource collection API of Namespaces. */ +/** + * Resource collection API of Namespaces. + */ public interface Namespaces { /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. + * + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response}. */ - CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters); + Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context); /** * Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the * domain name is created based on the service namespace name. - * - * @param parameters The namespace name. - * @param context The context to associate with this operation. + * + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. */ - Response checkAvailabilityWithResponse( - CheckAvailabilityParameters parameters, Context context); + CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 notification Hubs Namespace Resource along with {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String namespaceName); + Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, + Context context); + + /** + * Returns the given namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 notification Hubs Namespace Resource. + */ + NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName); /** * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String namespaceName, Context context); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String namespaceName, Context context); /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. */ - NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName); + void deleteByResourceGroup(String resourceGroupName, String namespaceName); /** - * Returns the description for the specified namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Lists all the available namespaces within the subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context); + PagedIterable list(); /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. + * Lists all the available namespaces within the subscription. + * + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with {@link PagedIterable}. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + PagedIterable list(String skipToken, Integer top, Context context); /** - * Deletes a namespace authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule Name. - * @param context The context to associate with this operation. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Lists the available namespaces within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken Skip token for subsequent requests. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 name. + * @return the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - SharedAccessAuthorizationRuleResource getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName); + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context); /** - * Gets an authorization rule for a namespace by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule name. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 name. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ - Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context); /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Creates an authorization rule for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ - PagedIterable listByResourceGroup(String resourceGroupName); + SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleResourceInner parameters); /** - * Lists the available namespaces within a resourceGroup. - * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return the {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 response of the List Namespace operation. */ - PagedIterable list(); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. - * + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation. + * @return an authorization rule for a namespace by name along with {@link Response}. */ - PagedIterable list(Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, Context context); /** - * Gets the authorization rules for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets an authorization rule for a namespace by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 authorization rules for a namespace. + * @return an authorization rule for a namespace by name. */ - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName); + SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName); /** * Gets the authorization rules for a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * Gets the authorization rules for a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Primary and Secondary ConnectionStrings to the namespace. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context); /** * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response}. */ - Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * Gets the Primary and Secondary ConnectionStrings to the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName 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/NotificationHub Connection String. + * @return the Primary and Secondary ConnectionStrings to the namespace. */ - ResourceListKeys regenerateKeys( - String resourceGroupName, String namespaceName, String authorizationRuleName, PolicykeyResource parameters); + ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName The connection string of the namespace for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters, Context context); /** - * Returns the description for the specified namespace. - * - * @param id the resource ID. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ - NamespaceResource getById(String id); + ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + PolicyKeyResource parameters); /** - * Returns the description for the specified namespace. - * - * @param id the resource ID. + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 Namespace resource. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); - - /** - * Gets an authorization rule for a namespace by 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 name. - */ - SharedAccessAuthorizationRuleResource getAuthorizationRuleById(String id); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Gets an authorization rule for a namespace by name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Lists the PNS credentials associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 an authorization rule for a namespace by name. + * @return description of a NotificationHub PNS Credentials. */ - Response getAuthorizationRuleByIdWithResponse(String id, Context context); + PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * + * Returns the given 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 notification Hubs Namespace Resource along with {@link Response}. */ - void deleteById(String id); + NamespaceResource getById(String id); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. - * + * Returns the given 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 notification Hubs Namespace Resource along with {@link Response}. */ - void deleteByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Deletes a namespace authorization rule. - * + * Deletes an existing namespace. This operation also removes all associated notificationHubs 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 deleteAuthorizationRuleById(String id); + void deleteById(String id); /** - * Deletes a namespace authorization rule. - * + * Deletes an existing namespace. This operation also removes all associated notificationHubs 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. - * @return the response. + * @return the {@link Response}. */ - Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); + Response deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new NamespaceResource resource. - * + * * @param name resource name. * @return the first stage of the new NamespaceResource definition. */ NamespaceResource.DefinitionStages.Blank define(String name); - - /** - * Begins definition for a new SharedAccessAuthorizationRuleResource resource. - * - * @param name resource name. - * @return the first stage of the new SharedAccessAuthorizationRuleResource definition. - */ - SharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NetworkAcls.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NetworkAcls.java new file mode 100644 index 000000000000..d4ba373f3df9 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NetworkAcls.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A collection of network authorization rules. + */ +@Fluent +public final class NetworkAcls { + /* + * List of IP rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /* + * A default (public Internet) network authorization rule, which contains rights if no other network rule matches. + */ + @JsonProperty(value = "publicNetworkRule") + private PublicInternetAuthorizationRule publicNetworkRule; + + /** + * Creates an instance of NetworkAcls class. + */ + public NetworkAcls() { + } + + /** + * Get the ipRules property: List of IP rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: List of IP rules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkAcls object itself. + */ + public NetworkAcls withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the publicNetworkRule property: A default (public Internet) network authorization rule, which contains + * rights if no other network rule matches. + * + * @return the publicNetworkRule value. + */ + public PublicInternetAuthorizationRule publicNetworkRule() { + return this.publicNetworkRule; + } + + /** + * Set the publicNetworkRule property: A default (public Internet) network authorization rule, which contains + * rights if no other network rule matches. + * + * @param publicNetworkRule the publicNetworkRule value to set. + * @return the NetworkAcls object itself. + */ + public NetworkAcls withPublicNetworkRule(PublicInternetAuthorizationRule publicNetworkRule) { + this.publicNetworkRule = publicNetworkRule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + if (publicNetworkRule() != null) { + publicNetworkRule().validate(); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubCreateOrUpdateParameters.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubCreateOrUpdateParameters.java deleted file mode 100644 index b09303dbac6f..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubCreateOrUpdateParameters.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubProperties; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Parameters supplied to the CreateOrUpdate NotificationHub operation. */ -@Fluent -public final class NotificationHubCreateOrUpdateParameters extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubCreateOrUpdateParameters.class); - - /* - * Properties of the NotificationHub. - */ - @JsonProperty(value = "properties", required = true) - private NotificationHubProperties innerProperties = new NotificationHubProperties(); - - /* - * The sku of the created namespace - */ - @JsonProperty(value = "sku") - private Sku sku; - - /** - * Get the innerProperties property: Properties of the NotificationHub. - * - * @return the innerProperties value. - */ - private NotificationHubProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationHubCreateOrUpdateParameters withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationHubCreateOrUpdateParameters withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the name property: The NotificationHub name. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: The NotificationHub name. - * - * @param name the name value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withName(name); - return this; - } - - /** - * Get the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @return the registrationTtl value. - */ - public String registrationTtl() { - return this.innerProperties() == null ? null : this.innerProperties().registrationTtl(); - } - - /** - * Set the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @param registrationTtl the registrationTtl value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withRegistrationTtl(String registrationTtl) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withRegistrationTtl(registrationTtl); - return this; - } - - /** - * Get the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @return the authorizationRules value. - */ - public List authorizationRules() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationRules(); - } - - /** - * Set the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @param authorizationRules the authorizationRules value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withAuthorizationRules( - List authorizationRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withAuthorizationRules(authorizationRules); - return this; - } - - /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. - */ - public ApnsCredential apnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().apnsCredential(); - } - - /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential the apnsCredential value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withApnsCredential(ApnsCredential apnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withApnsCredential(apnsCredential); - return this; - } - - /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. - */ - public WnsCredential wnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().wnsCredential(); - } - - /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential the wnsCredential value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withWnsCredential(WnsCredential wnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withWnsCredential(wnsCredential); - return this; - } - - /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. - */ - public GcmCredential gcmCredential() { - return this.innerProperties() == null ? null : this.innerProperties().gcmCredential(); - } - - /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential the gcmCredential value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withGcmCredential(GcmCredential gcmCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withGcmCredential(gcmCredential); - return this; - } - - /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. - */ - public MpnsCredential mpnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().mpnsCredential(); - } - - /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential the mpnsCredential value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withMpnsCredential(MpnsCredential mpnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withMpnsCredential(mpnsCredential); - return this; - } - - /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. - */ - public AdmCredential admCredential() { - return this.innerProperties() == null ? null : this.innerProperties().admCredential(); - } - - /** - * Set the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential the admCredential value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withAdmCredential(AdmCredential admCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withAdmCredential(admCredential); - return this; - } - - /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. - */ - public BaiduCredential baiduCredential() { - return this.innerProperties() == null ? null : this.innerProperties().baiduCredential(); - } - - /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential the baiduCredential value to set. - * @return the NotificationHubCreateOrUpdateParameters object itself. - */ - public NotificationHubCreateOrUpdateParameters withBaiduCredential(BaiduCredential baiduCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withBaiduCredential(baiduCredential); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model NotificationHubCreateOrUpdateParameters")); - } else { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubListResult.java index 98f73934118c..c7111b47d99f 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubListResult.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubListResult.java @@ -4,76 +4,55 @@ package com.azure.resourcemanager.notificationhubs.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of the List NotificationHub operation. */ -@Fluent +/** + * The response of the List NotificationHub operation. + */ +@Immutable public final class NotificationHubListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubListResult.class); - /* - * Result of the List NotificationHub operation. + * Gets or sets result of the List AuthorizationRules operation. */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of NotificationHub + * Gets or sets link to the next set of results. */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: Result of the List NotificationHub operation. - * - * @return the value value. + * Creates an instance of NotificationHubListResult class. */ - public List value() { - return this.value; + public NotificationHubListResult() { } /** - * Set the value property: Result of the List NotificationHub operation. - * - * @param value the value value to set. - * @return the NotificationHubListResult object itself. + * Get the value property: Gets or sets result of the List AuthorizationRules operation. + * + * @return the value value. */ - public NotificationHubListResult withValue(List value) { - this.value = value; - return this; + public List value() { + return this.value; } /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * NotificationHub. - * + * Get the nextLink property: Gets or sets link to the next set of results. + * * @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 - * NotificationHub. - * - * @param nextLink the nextLink value to set. - * @return the NotificationHubListResult object itself. - */ - public NotificationHubListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubPatchParameters.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubPatchParameters.java index 23d02c3cfca9..3e996577a22f 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubPatchParameters.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubPatchParameters.java @@ -5,291 +5,108 @@ package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubProperties; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; import java.util.Map; -/** Parameters supplied to the patch NotificationHub operation. */ +/** + * Patch parameter for NamespaceResource. + */ @Fluent -public final class NotificationHubPatchParameters extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubPatchParameters.class); - +public final class NotificationHubPatchParameters { /* - * Properties of the NotificationHub. + * NotificationHub properties. */ @JsonProperty(value = "properties") - private NotificationHubProperties innerProperties; + private NotificationHubProperties properties; /* - * The sku of the created namespace + * The Sku description for a namespace */ @JsonProperty(value = "sku") private Sku sku; - /** - * Get the innerProperties property: Properties of the NotificationHub. - * - * @return the innerProperties value. - */ - private NotificationHubProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the created namespace. - * - * @param sku the sku value to set. - * @return the NotificationHubPatchParameters object itself. - */ - public NotificationHubPatchParameters withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationHubPatchParameters withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationHubPatchParameters withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the name property: The NotificationHub name. - * - * @return the name value. - */ - public String namePropertiesName() { - return this.innerProperties() == null ? null : this.innerProperties().name(); - } - - /** - * Set the name property: The NotificationHub name. - * - * @param name the name value to set. - * @return the NotificationHubPatchParameters object itself. - */ - public NotificationHubPatchParameters withNamePropertiesName(String name) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withName(name); - return this; - } - - /** - * Get the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @return the registrationTtl value. - */ - public String registrationTtl() { - return this.innerProperties() == null ? null : this.innerProperties().registrationTtl(); - } - - /** - * Set the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @param registrationTtl the registrationTtl value to set. - * @return the NotificationHubPatchParameters object itself. - */ - public NotificationHubPatchParameters withRegistrationTtl(String registrationTtl) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withRegistrationTtl(registrationTtl); - return this; - } - - /** - * Get the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @return the authorizationRules value. - */ - public List authorizationRules() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationRules(); - } - - /** - * Set the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @param authorizationRules the authorizationRules value to set. - * @return the NotificationHubPatchParameters object itself. - */ - public NotificationHubPatchParameters withAuthorizationRules( - List authorizationRules) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withAuthorizationRules(authorizationRules); - return this; - } - - /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. - */ - public ApnsCredential apnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().apnsCredential(); - } - - /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential the apnsCredential value to set. - * @return the NotificationHubPatchParameters object itself. - */ - public NotificationHubPatchParameters withApnsCredential(ApnsCredential apnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withApnsCredential(apnsCredential); - return this; - } - - /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. - */ - public WnsCredential wnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().wnsCredential(); - } - - /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential the wnsCredential value to set. - * @return the NotificationHubPatchParameters object itself. - */ - public NotificationHubPatchParameters withWnsCredential(WnsCredential wnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withWnsCredential(wnsCredential); - return this; - } - - /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. + /* + * Dictionary of */ - public GcmCredential gcmCredential() { - return this.innerProperties() == null ? null : this.innerProperties().gcmCredential(); - } + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential the gcmCredential value to set. - * @return the NotificationHubPatchParameters object itself. + * Creates an instance of NotificationHubPatchParameters class. */ - public NotificationHubPatchParameters withGcmCredential(GcmCredential gcmCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withGcmCredential(gcmCredential); - return this; + public NotificationHubPatchParameters() { } /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. + * Get the properties property: NotificationHub properties. + * + * @return the properties value. */ - public MpnsCredential mpnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().mpnsCredential(); + public NotificationHubProperties properties() { + return this.properties; } /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential the mpnsCredential value to set. + * Set the properties property: NotificationHub properties. + * + * @param properties the properties value to set. * @return the NotificationHubPatchParameters object itself. */ - public NotificationHubPatchParameters withMpnsCredential(MpnsCredential mpnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withMpnsCredential(mpnsCredential); + public NotificationHubPatchParameters withProperties(NotificationHubProperties properties) { + this.properties = properties; return this; } /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. + * Get the sku property: The Sku description for a namespace. + * + * @return the sku value. */ - public AdmCredential admCredential() { - return this.innerProperties() == null ? null : this.innerProperties().admCredential(); + public Sku sku() { + return this.sku; } /** - * Set the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential the admCredential value to set. + * Set the sku property: The Sku description for a namespace. + * + * @param sku the sku value to set. * @return the NotificationHubPatchParameters object itself. */ - public NotificationHubPatchParameters withAdmCredential(AdmCredential admCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withAdmCredential(admCredential); + public NotificationHubPatchParameters withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. */ - public BaiduCredential baiduCredential() { - return this.innerProperties() == null ? null : this.innerProperties().baiduCredential(); + public Map tags() { + return this.tags; } /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential the baiduCredential value to set. + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. * @return the NotificationHubPatchParameters object itself. */ - public NotificationHubPatchParameters withBaiduCredential(BaiduCredential baiduCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new NotificationHubProperties(); - } - this.innerProperties().withBaiduCredential(baiduCredential); + public NotificationHubPatchParameters withTags(Map tags) { + this.tags = tags; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (sku() != null) { sku().validate(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubProperties.java similarity index 50% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubProperties.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubProperties.java index 60f154e59a18..77557045f65c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubProperties.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubProperties.java @@ -2,82 +2,104 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.notificationhubs.fluent.models; +package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.models.AdmCredential; -import com.azure.resourcemanager.notificationhubs.models.ApnsCredential; -import com.azure.resourcemanager.notificationhubs.models.BaiduCredential; -import com.azure.resourcemanager.notificationhubs.models.GcmCredential; -import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; -import com.azure.resourcemanager.notificationhubs.models.WnsCredential; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** NotificationHub properties. */ +/** + * NotificationHub properties. + */ @Fluent public final class NotificationHubProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubProperties.class); - /* - * The NotificationHub name. + * Gets or sets the NotificationHub name. */ @JsonProperty(value = "name") private String name; /* - * The RegistrationTtl of the created NotificationHub + * Gets or sets the RegistrationTtl of the created NotificationHub */ @JsonProperty(value = "registrationTtl") private String registrationTtl; /* - * The AuthorizationRules of the created NotificationHub + * Gets or sets the AuthorizationRules of the created NotificationHub */ - @JsonProperty(value = "authorizationRules") + @JsonProperty(value = "authorizationRules", access = JsonProperty.Access.WRITE_ONLY) private List authorizationRules; /* - * The ApnsCredential of the created NotificationHub + * Description of a NotificationHub ApnsCredential. */ @JsonProperty(value = "apnsCredential") private ApnsCredential apnsCredential; /* - * The WnsCredential of the created NotificationHub + * Description of a NotificationHub WnsCredential. */ @JsonProperty(value = "wnsCredential") private WnsCredential wnsCredential; /* - * The GcmCredential of the created NotificationHub + * Description of a NotificationHub GcmCredential. */ @JsonProperty(value = "gcmCredential") private GcmCredential gcmCredential; /* - * The MpnsCredential of the created NotificationHub + * Description of a NotificationHub MpnsCredential. */ @JsonProperty(value = "mpnsCredential") private MpnsCredential mpnsCredential; /* - * The AdmCredential of the created NotificationHub + * Description of a NotificationHub AdmCredential. */ @JsonProperty(value = "admCredential") private AdmCredential admCredential; /* - * The BaiduCredential of the created NotificationHub + * Description of a NotificationHub BaiduCredential. */ @JsonProperty(value = "baiduCredential") private BaiduCredential baiduCredential; + /* + * Description of a NotificationHub BrowserCredential. + */ + @JsonProperty(value = "browserCredential") + private BrowserCredential browserCredential; + + /* + * Description of a NotificationHub XiaomiCredential. + */ + @JsonProperty(value = "xiaomiCredential") + private XiaomiCredential xiaomiCredential; + + /* + * Description of a NotificationHub FcmV1Credential. + */ + @JsonProperty(value = "fcmV1Credential") + private FcmV1Credential fcmV1Credential; + + /* + * The dailyMaxActiveDevices property. + */ + @JsonProperty(value = "dailyMaxActiveDevices", access = JsonProperty.Access.WRITE_ONLY) + private Long dailyMaxActiveDevices; + + /** + * Creates an instance of NotificationHubProperties class. + */ + public NotificationHubProperties() { + } + /** - * Get the name property: The NotificationHub name. - * + * Get the name property: Gets or sets the NotificationHub name. + * * @return the name value. */ public String name() { @@ -85,8 +107,8 @@ public String name() { } /** - * Set the name property: The NotificationHub name. - * + * Set the name property: Gets or sets the NotificationHub name. + * * @param name the name value to set. * @return the NotificationHubProperties object itself. */ @@ -96,8 +118,8 @@ public NotificationHubProperties withName(String name) { } /** - * Get the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * + * Get the registrationTtl property: Gets or sets the RegistrationTtl of the created NotificationHub. + * * @return the registrationTtl value. */ public String registrationTtl() { @@ -105,8 +127,8 @@ public String registrationTtl() { } /** - * Set the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * + * Set the registrationTtl property: Gets or sets the RegistrationTtl of the created NotificationHub. + * * @param registrationTtl the registrationTtl value to set. * @return the NotificationHubProperties object itself. */ @@ -116,8 +138,8 @@ public NotificationHubProperties withRegistrationTtl(String registrationTtl) { } /** - * Get the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * + * Get the authorizationRules property: Gets or sets the AuthorizationRules of the created NotificationHub. + * * @return the authorizationRules value. */ public List authorizationRules() { @@ -125,20 +147,8 @@ public List authorizationRules() { } /** - * Set the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @param authorizationRules the authorizationRules value to set. - * @return the NotificationHubProperties object itself. - */ - public NotificationHubProperties withAuthorizationRules( - List authorizationRules) { - this.authorizationRules = authorizationRules; - return this; - } - - /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. - * + * Get the apnsCredential property: Description of a NotificationHub ApnsCredential. + * * @return the apnsCredential value. */ public ApnsCredential apnsCredential() { @@ -146,8 +156,8 @@ public ApnsCredential apnsCredential() { } /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * + * Set the apnsCredential property: Description of a NotificationHub ApnsCredential. + * * @param apnsCredential the apnsCredential value to set. * @return the NotificationHubProperties object itself. */ @@ -157,8 +167,8 @@ public NotificationHubProperties withApnsCredential(ApnsCredential apnsCredentia } /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. - * + * Get the wnsCredential property: Description of a NotificationHub WnsCredential. + * * @return the wnsCredential value. */ public WnsCredential wnsCredential() { @@ -166,8 +176,8 @@ public WnsCredential wnsCredential() { } /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. - * + * Set the wnsCredential property: Description of a NotificationHub WnsCredential. + * * @param wnsCredential the wnsCredential value to set. * @return the NotificationHubProperties object itself. */ @@ -177,8 +187,8 @@ public NotificationHubProperties withWnsCredential(WnsCredential wnsCredential) } /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. - * + * Get the gcmCredential property: Description of a NotificationHub GcmCredential. + * * @return the gcmCredential value. */ public GcmCredential gcmCredential() { @@ -186,8 +196,8 @@ public GcmCredential gcmCredential() { } /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * + * Set the gcmCredential property: Description of a NotificationHub GcmCredential. + * * @param gcmCredential the gcmCredential value to set. * @return the NotificationHubProperties object itself. */ @@ -197,8 +207,8 @@ public NotificationHubProperties withGcmCredential(GcmCredential gcmCredential) } /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * + * Get the mpnsCredential property: Description of a NotificationHub MpnsCredential. + * * @return the mpnsCredential value. */ public MpnsCredential mpnsCredential() { @@ -206,8 +216,8 @@ public MpnsCredential mpnsCredential() { } /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * + * Set the mpnsCredential property: Description of a NotificationHub MpnsCredential. + * * @param mpnsCredential the mpnsCredential value to set. * @return the NotificationHubProperties object itself. */ @@ -217,8 +227,8 @@ public NotificationHubProperties withMpnsCredential(MpnsCredential mpnsCredentia } /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. - * + * Get the admCredential property: Description of a NotificationHub AdmCredential. + * * @return the admCredential value. */ public AdmCredential admCredential() { @@ -226,8 +236,8 @@ public AdmCredential admCredential() { } /** - * Set the admCredential property: The AdmCredential of the created NotificationHub. - * + * Set the admCredential property: Description of a NotificationHub AdmCredential. + * * @param admCredential the admCredential value to set. * @return the NotificationHubProperties object itself. */ @@ -237,8 +247,8 @@ public NotificationHubProperties withAdmCredential(AdmCredential admCredential) } /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. - * + * Get the baiduCredential property: Description of a NotificationHub BaiduCredential. + * * @return the baiduCredential value. */ public BaiduCredential baiduCredential() { @@ -246,8 +256,8 @@ public BaiduCredential baiduCredential() { } /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. - * + * Set the baiduCredential property: Description of a NotificationHub BaiduCredential. + * * @param baiduCredential the baiduCredential value to set. * @return the NotificationHubProperties object itself. */ @@ -256,9 +266,78 @@ public NotificationHubProperties withBaiduCredential(BaiduCredential baiduCreden return this; } + /** + * Get the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @return the browserCredential value. + */ + public BrowserCredential browserCredential() { + return this.browserCredential; + } + + /** + * Set the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @param browserCredential the browserCredential value to set. + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withBrowserCredential(BrowserCredential browserCredential) { + this.browserCredential = browserCredential; + return this; + } + + /** + * Get the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @return the xiaomiCredential value. + */ + public XiaomiCredential xiaomiCredential() { + return this.xiaomiCredential; + } + + /** + * Set the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @param xiaomiCredential the xiaomiCredential value to set. + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withXiaomiCredential(XiaomiCredential xiaomiCredential) { + this.xiaomiCredential = xiaomiCredential; + return this; + } + + /** + * Get the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @return the fcmV1Credential value. + */ + public FcmV1Credential fcmV1Credential() { + return this.fcmV1Credential; + } + + /** + * Set the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @param fcmV1Credential the fcmV1Credential value to set. + * @return the NotificationHubProperties object itself. + */ + public NotificationHubProperties withFcmV1Credential(FcmV1Credential fcmV1Credential) { + this.fcmV1Credential = fcmV1Credential; + return this; + } + + /** + * Get the dailyMaxActiveDevices property: The dailyMaxActiveDevices property. + * + * @return the dailyMaxActiveDevices value. + */ + public Long dailyMaxActiveDevices() { + return this.dailyMaxActiveDevices; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -283,5 +362,14 @@ public void validate() { if (baiduCredential() != null) { baiduCredential().validate(); } + if (browserCredential() != null) { + browserCredential().validate(); + } + if (xiaomiCredential() != null) { + xiaomiCredential().validate(); + } + if (fcmV1Credential() != null) { + fcmV1Credential().validate(); + } } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubResource.java index 4b0f0bfb3673..7fc6ebf5088d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubResource.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubResource.java @@ -6,157 +6,123 @@ 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.notificationhubs.fluent.models.NotificationHubResourceInner; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import java.util.List; import java.util.Map; -/** An immutable client-side representation of NotificationHubResource. */ +/** + * An immutable client-side representation of NotificationHubResource. + */ public interface NotificationHubResource { /** * 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: The sku of the created namespace. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the namePropertiesName property: The NotificationHub name. - * - * @return the namePropertiesName value. - */ - String namePropertiesName(); - - /** - * Gets the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @return the registrationTtl value. - */ - String registrationTtl(); - - /** - * Gets the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @return the authorizationRules value. - */ - List authorizationRules(); - - /** - * Gets the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. - */ - ApnsCredential apnsCredential(); - - /** - * Gets the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. - */ - WnsCredential wnsCredential(); - - /** - * Gets the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. + * Gets the properties property: NotificationHub properties. + * + * @return the properties value. */ - GcmCredential gcmCredential(); + NotificationHubProperties properties(); /** - * Gets the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. - */ - MpnsCredential mpnsCredential(); - - /** - * Gets the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. + * Gets the sku property: The Sku description for a namespace. + * + * @return the sku value. */ - AdmCredential admCredential(); + Sku sku(); /** - * Gets the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - BaiduCredential baiduCredential(); + SystemData systemData(); /** * 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.notificationhubs.fluent.models.NotificationHubResourceInner object. - * + * * @return the inner object. */ NotificationHubResourceInner innerModel(); - /** The entirety of the NotificationHubResource definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { + /** + * The entirety of the NotificationHubResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The NotificationHubResource definition stages. */ + + /** + * The NotificationHubResource definition stages. + */ interface DefinitionStages { - /** The first stage of the NotificationHubResource definition. */ + /** + * The first stage of the NotificationHubResource definition. + */ interface Blank extends WithLocation { } - /** The stage of the NotificationHubResource definition allowing to specify location. */ + + /** + * The stage of the NotificationHubResource 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. */ @@ -164,366 +130,212 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the NotificationHubResource definition allowing to specify parent resource. */ + + /** + * The stage of the NotificationHubResource definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, namespaceName. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. * @return the next definition stage. */ WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); } + /** * The stage of the NotificationHubResource 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.WithNamePropertiesName, - DefinitionStages.WithRegistrationTtl, - DefinitionStages.WithAuthorizationRules, - DefinitionStages.WithApnsCredential, - DefinitionStages.WithWnsCredential, - DefinitionStages.WithGcmCredential, - DefinitionStages.WithMpnsCredential, - DefinitionStages.WithAdmCredential, - DefinitionStages.WithBaiduCredential { + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithSku { /** * Executes the create request. - * + * * @return the created resource. */ NotificationHubResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ NotificationHubResource create(Context context); } - /** The stage of the NotificationHubResource definition allowing to specify tags. */ + + /** + * The stage of the NotificationHubResource 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 NotificationHubResource definition allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku property: The sku of the created namespace. - * - * @param sku The sku of the created namespace. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - /** The stage of the NotificationHubResource definition allowing to specify namePropertiesName. */ - interface WithNamePropertiesName { - /** - * Specifies the namePropertiesName property: The NotificationHub name.. - * - * @param namePropertiesName The NotificationHub name. - * @return the next definition stage. - */ - WithCreate withNamePropertiesName(String namePropertiesName); - } - /** The stage of the NotificationHubResource definition allowing to specify registrationTtl. */ - interface WithRegistrationTtl { - /** - * Specifies the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @param registrationTtl The RegistrationTtl of the created NotificationHub. - * @return the next definition stage. - */ - WithCreate withRegistrationTtl(String registrationTtl); - } - /** The stage of the NotificationHubResource definition allowing to specify authorizationRules. */ - interface WithAuthorizationRules { - /** - * Specifies the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @param authorizationRules The AuthorizationRules of the created NotificationHub. - * @return the next definition stage. - */ - WithCreate withAuthorizationRules(List authorizationRules); - } - /** The stage of the NotificationHubResource definition allowing to specify apnsCredential. */ - interface WithApnsCredential { - /** - * Specifies the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential The ApnsCredential of the created NotificationHub. - * @return the next definition stage. - */ - WithCreate withApnsCredential(ApnsCredential apnsCredential); - } - /** The stage of the NotificationHubResource definition allowing to specify wnsCredential. */ - interface WithWnsCredential { - /** - * Specifies the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential The WnsCredential of the created NotificationHub. - * @return the next definition stage. - */ - WithCreate withWnsCredential(WnsCredential wnsCredential); - } - /** The stage of the NotificationHubResource definition allowing to specify gcmCredential. */ - interface WithGcmCredential { - /** - * Specifies the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential The GcmCredential of the created NotificationHub. - * @return the next definition stage. - */ - WithCreate withGcmCredential(GcmCredential gcmCredential); - } - /** The stage of the NotificationHubResource definition allowing to specify mpnsCredential. */ - interface WithMpnsCredential { - /** - * Specifies the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential The MpnsCredential of the created NotificationHub. - * @return the next definition stage. - */ - WithCreate withMpnsCredential(MpnsCredential mpnsCredential); - } - /** The stage of the NotificationHubResource definition allowing to specify admCredential. */ - interface WithAdmCredential { + + /** + * The stage of the NotificationHubResource definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential The AdmCredential of the created NotificationHub. + * Specifies the properties property: NotificationHub properties.. + * + * @param properties NotificationHub properties. * @return the next definition stage. */ - WithCreate withAdmCredential(AdmCredential admCredential); + WithCreate withProperties(NotificationHubProperties properties); } - /** The stage of the NotificationHubResource definition allowing to specify baiduCredential. */ - interface WithBaiduCredential { + + /** + * The stage of the NotificationHubResource definition allowing to specify sku. + */ + interface WithSku { /** - * Specifies the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential The BaiduCredential of the created NotificationHub. + * Specifies the sku property: The Sku description for a namespace. + * + * @param sku The Sku description for a namespace. * @return the next definition stage. */ - WithCreate withBaiduCredential(BaiduCredential baiduCredential); + WithCreate withSku(Sku sku); } } + /** * Begins update for the NotificationHubResource resource. - * + * * @return the stage of resource update. */ NotificationHubResource.Update update(); - /** The template for NotificationHubResource update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithSku, - UpdateStages.WithNamePropertiesName, - UpdateStages.WithRegistrationTtl, - UpdateStages.WithAuthorizationRules, - UpdateStages.WithApnsCredential, - UpdateStages.WithWnsCredential, - UpdateStages.WithGcmCredential, - UpdateStages.WithMpnsCredential, - UpdateStages.WithAdmCredential, - UpdateStages.WithBaiduCredential { + /** + * The template for NotificationHubResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithSku { /** * Executes the update request. - * + * * @return the updated resource. */ NotificationHubResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ NotificationHubResource apply(Context context); } - /** The NotificationHubResource update stages. */ + + /** + * The NotificationHubResource update stages. + */ interface UpdateStages { - /** The stage of the NotificationHubResource update allowing to specify tags. */ + /** + * The stage of the NotificationHubResource update allowing to specify tags. + */ interface WithTags { /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. + * Specifies the tags property: Dictionary of <string>. + * + * @param tags Dictionary of <string>. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the NotificationHubResource update allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku property: The sku of the created namespace. - * - * @param sku The sku of the created namespace. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - /** The stage of the NotificationHubResource update allowing to specify namePropertiesName. */ - interface WithNamePropertiesName { - /** - * Specifies the namePropertiesName property: The NotificationHub name.. - * - * @param namePropertiesName The NotificationHub name. - * @return the next definition stage. - */ - Update withNamePropertiesName(String namePropertiesName); - } - /** The stage of the NotificationHubResource update allowing to specify registrationTtl. */ - interface WithRegistrationTtl { - /** - * Specifies the registrationTtl property: The RegistrationTtl of the created NotificationHub. - * - * @param registrationTtl The RegistrationTtl of the created NotificationHub. - * @return the next definition stage. - */ - Update withRegistrationTtl(String registrationTtl); - } - /** The stage of the NotificationHubResource update allowing to specify authorizationRules. */ - interface WithAuthorizationRules { - /** - * Specifies the authorizationRules property: The AuthorizationRules of the created NotificationHub. - * - * @param authorizationRules The AuthorizationRules of the created NotificationHub. - * @return the next definition stage. - */ - Update withAuthorizationRules(List authorizationRules); - } - /** The stage of the NotificationHubResource update allowing to specify apnsCredential. */ - interface WithApnsCredential { - /** - * Specifies the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential The ApnsCredential of the created NotificationHub. - * @return the next definition stage. - */ - Update withApnsCredential(ApnsCredential apnsCredential); - } - /** The stage of the NotificationHubResource update allowing to specify wnsCredential. */ - interface WithWnsCredential { - /** - * Specifies the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @param wnsCredential The WnsCredential of the created NotificationHub. - * @return the next definition stage. - */ - Update withWnsCredential(WnsCredential wnsCredential); - } - /** The stage of the NotificationHubResource update allowing to specify gcmCredential. */ - interface WithGcmCredential { - /** - * Specifies the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential The GcmCredential of the created NotificationHub. - * @return the next definition stage. - */ - Update withGcmCredential(GcmCredential gcmCredential); - } - /** The stage of the NotificationHubResource update allowing to specify mpnsCredential. */ - interface WithMpnsCredential { - /** - * Specifies the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential The MpnsCredential of the created NotificationHub. - * @return the next definition stage. - */ - Update withMpnsCredential(MpnsCredential mpnsCredential); - } - /** The stage of the NotificationHubResource update allowing to specify admCredential. */ - interface WithAdmCredential { + + /** + * The stage of the NotificationHubResource update allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the admCredential property: The AdmCredential of the created NotificationHub. - * - * @param admCredential The AdmCredential of the created NotificationHub. + * Specifies the properties property: NotificationHub properties.. + * + * @param properties NotificationHub properties. * @return the next definition stage. */ - Update withAdmCredential(AdmCredential admCredential); + Update withProperties(NotificationHubProperties properties); } - /** The stage of the NotificationHubResource update allowing to specify baiduCredential. */ - interface WithBaiduCredential { + + /** + * The stage of the NotificationHubResource update allowing to specify sku. + */ + interface WithSku { /** - * Specifies the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @param baiduCredential The BaiduCredential of the created NotificationHub. + * Specifies the sku property: The Sku description for a namespace. + * + * @param sku The Sku description for a namespace. * @return the next definition stage. */ - Update withBaiduCredential(BaiduCredential baiduCredential); + Update withSku(Sku sku); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ NotificationHubResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ NotificationHubResource refresh(Context context); /** - * test send a push notification. - * + * Test send a push notification. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. + * @return description of a NotificationHub Resource along with {@link Response}. */ - DebugSendResponse debugSend(); + Response debugSendWithResponse(Context context); /** - * test send a push notification. - * - * @param parameters Debug send parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Test send a push notification. + * * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. */ - Response debugSendWithResponse(Object parameters, Context context); + DebugSendResponse debugSend(); /** - * Lists the PNS Credentials associated with a notification hub . - * + * Lists the PNS Credentials associated with a notification hub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub PNS Credentials. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ - PnsCredentialsResource getPnsCredentials(); + Response getPnsCredentialsWithResponse(Context context); /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Lists the PNS Credentials associated with a notification hub. + * * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub PNS Credentials. */ - Response getPnsCredentialsWithResponse(Context context); + PnsCredentialsResource getPnsCredentials(); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubs.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubs.java index d110d611d45b..398b087db214 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubs.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubs.java @@ -8,442 +8,437 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of NotificationHubs. */ +/** + * Resource collection API of NotificationHubs. + */ public interface NotificationHubs { /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. + * @return description of a CheckAvailability resource along with {@link Response}. */ - CheckAvailabilityResult checkNotificationHubAvailability( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters); + Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context); /** * Checks the availability of the given notificationHub in a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters The notificationHub name. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 CheckAvailability resource. */ - Response checkNotificationHubAvailabilityWithResponse( - String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, Context context); + CheckAvailabilityResult checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters); /** - * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification hub along with {@link Response}. */ - void delete(String resourceGroupName, String namespaceName, String notificationHubName); + Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); + + /** + * Gets the notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the notification hub. + */ + NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName); /** * Deletes a notification hub associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + Response deleteWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, + Context context); /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notification hub associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. */ - NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName); + void delete(String resourceGroupName, String namespaceName, String notificationHubName); /** * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + PagedIterable list(String resourceGroupName, String namespaceName); /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Lists the notification hubs associated with a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param skipToken Continuation token. + * @param top Page size. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 NotificationHub Resource. + * @return the response of the List NotificationHub operation as paginated response with {@link PagedIterable}. */ - DebugSendResponse debugSend(String resourceGroupName, String namespaceName, String notificationHubName); + PagedIterable list(String resourceGroupName, String namespaceName, String skipToken, + Integer top, Context context); /** - * test send a push notification. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param parameters Debug send parameters. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return description of a NotificationHub Resource along with {@link Response}. */ - Response debugSendWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Object parameters, Context context); + Response debugSendWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * Test send a push notification. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace AuthorizationRules. + * @return description of a NotificationHub Resource. */ - SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters); + DebugSendResponse debugSend(String resourceGroupName, String namespaceName, String notificationHubName); /** - * Creates/Updates an authorization rule for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Deletes a notificationHub authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName 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 AuthorizationRules. - */ - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - Context context); + * @return the {@link Response}. + */ + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context); /** * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName 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 notificationHubName, String authorizationRuleName); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName); /** - * Deletes a notificationHub authorization rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Gets an authorization rule for a NotificationHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return an authorization rule for a NotificationHub by name along with {@link Response}. */ - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, Context context); /** * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 NotificationHub by name. */ - SharedAccessAuthorizationRuleResource getAuthorizationRule( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName); /** - * Gets an authorization rule for a NotificationHub by name. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName authorization rule name. - * @param context The context to associate with this operation. + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an authorization rule for a NotificationHub by name. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedIterable}. */ - Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName); /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets the authorization rules for a NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List NotificationHub operation. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String namespaceName); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, String notificationHubName, Context context); /** - * Lists the notification hubs associated with a namespace. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List NotificationHub operation. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String namespaceName, Context context); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context); /** - * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName 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 authorization rules for a NotificationHub. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub. */ - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName); + ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName); /** - * Gets the authorization rules for a NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 NotificationHub. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @param authorizationRuleName Authorization Rule Name. + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ConnectionStrings to the NotificationHub. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ - ResourceListKeys listKeys( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName); + ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName, PolicyKeyResource parameters); /** - * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Primary and Secondary ConnectionStrings to the NotificationHub. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ - Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - Context context); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * Lists the PNS Credentials associated with a notification hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a NotificationHub PNS Credentials. + */ + PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName); + + /** + * Gets the notification hub. + * + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/NotificationHub Connection String. + * @return the notification hub along with {@link Response}. */ - ResourceListKeys regenerateKeys( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters); + NotificationHubResource getById(String id); /** - * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. - * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule. - * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key. + * Gets the notification hub. + * + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/NotificationHub Connection String. - */ - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String notificationHubName, - String authorizationRuleName, - PolicykeyResource parameters, - Context context); + * @return the notification hub along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Gets an authorization rule for a NotificationHub by 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 description of a NotificationHub PNS Credentials. + * @return an authorization rule for a NotificationHub by name along with {@link Response}. */ - PnsCredentialsResource getPnsCredentials( - String resourceGroupName, String namespaceName, String notificationHubName); + SharedAccessAuthorizationRuleResource getAuthorizationRuleById(String id); /** - * Lists the PNS Credentials associated with a notification hub . - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * Gets an authorization rule for a NotificationHub by 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 description of a NotificationHub PNS Credentials. + * @return an authorization rule for a NotificationHub by name along with {@link Response}. */ - Response getPnsCredentialsWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, Context context); + Response getAuthorizationRuleByIdWithResponse(String id, Context context); /** - * Lists the notification hubs associated with a namespace. - * + * Deletes a notification hub associated with a namespace. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. */ - NotificationHubResource getById(String id); + void deleteById(String id); /** - * Lists the notification hubs associated with a namespace. - * + * Deletes a notification hub associated with a namespace. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a NotificationHub Resource. + * @return the {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response deleteByIdWithResponse(String id, Context context); /** - * Deletes a notification hub associated with a namespace. - * + * Deletes a notificationHub 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 deleteById(String id); + void deleteAuthorizationRuleById(String id); /** - * Deletes a notification hub associated with a namespace. - * + * Deletes a notificationHub authorization rule. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); + Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); /** * Begins definition for a new NotificationHubResource resource. - * + * * @param name resource name. * @return the first stage of the new NotificationHubResource definition. */ NotificationHubResource.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new SharedAccessAuthorizationRuleResource resource. + * + * @param name resource name. + * @return the first stage of the new SharedAccessAuthorizationRuleResource definition. + */ + SharedAccessAuthorizationRuleResource.DefinitionStages.Blank defineAuthorizationRule(String name); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operation.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operation.java index 95fbe6ab9f34..aeddcc1c21e5 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operation.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operation.java @@ -6,25 +6,42 @@ import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * + * Gets the name property: Gets operation name: {provider}/{resource}/{operation}. + * * @return the name value. */ String name(); /** * Gets the display property: The object that represents the operation. - * + * * @return the display value. */ OperationDisplay display(); + /** + * Gets the properties property: Optional operation properties. + * + * @return the properties value. + */ + OperationProperties properties(); + + /** + * Gets the isDataAction property: Gets or sets IsDataAction property. It is used to differentiate management and + * data plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationDisplay.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationDisplay.java index 751ada6bd3cf..de6423de6b89 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationDisplay.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationDisplay.java @@ -5,36 +5,46 @@ package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The object that represents the operation. */ +/** + * The object that represents the operation. + */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* - * Service provider: Microsoft.NotificationHubs + * Gets service provider: Microsoft.NotificationHubs */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * Resource on which the operation is performed: Invoice, etc. + * Gets resource on which the operation is performed: Invoice, etc. */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * Operation type: Read, write, delete, etc. + * Gets operation type: Read, write, delete, etc. */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; + /* + * Human-friendly operation description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + /** - * Get the provider property: Service provider: Microsoft.NotificationHubs. - * + * Get the provider property: Gets service provider: Microsoft.NotificationHubs. + * * @return the provider value. */ public String provider() { @@ -42,8 +52,8 @@ public String provider() { } /** - * Get the resource property: Resource on which the operation is performed: Invoice, etc. - * + * Get the resource property: Gets resource on which the operation is performed: Invoice, etc. + * * @return the resource value. */ public String resource() { @@ -51,17 +61,26 @@ public String resource() { } /** - * Get the operation property: Operation type: Read, write, delete, etc. - * + * Get the operation property: Gets operation type: Read, write, delete, etc. + * * @return the operation value. */ public String operation() { return this.operation; } + /** + * Get the description property: Human-friendly operation description. + * + * @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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationListResult.java index 5db3a18fb842..0a8d5601052c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationListResult.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationListResult.java @@ -5,37 +5,40 @@ package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** - * Result of the request to list NotificationHubs operations. It contains a list of operations and a URL link to get the - * next set of results. + * Result of the request to list NotificationHubs operations. It contains + * a list of operations and a URL link to get the next set of results. */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* - * List of NotificationHubs operations supported by the + * Gets list of NotificationHubs operations supported by the * Microsoft.NotificationHubs 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. + * Gets URL to get the next set of operation list results if there are + * any. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: List of NotificationHubs operations supported by the Microsoft.NotificationHubs resource - * provider. - * + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: Gets list of NotificationHubs operations supported by the + * Microsoft.NotificationHubs resource provider. + * * @return the value value. */ public List value() { @@ -43,8 +46,9 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * + * Get the nextLink property: Gets URL to get the next set of operation list results if there are + * any. + * * @return the nextLink value. */ public String nextLink() { @@ -53,7 +57,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProperties.java new file mode 100644 index 000000000000..7176d08c6ad7 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProperties.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Optional operation properties. + */ +@Fluent +public final class OperationProperties { + /* + * Optional service specification used in Operations API. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Creates an instance of OperationProperties class. + */ + public OperationProperties() { + } + + /** + * Get the serviceSpecification property: Optional service specification used in Operations API. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Optional service specification used in Operations API. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProvisioningState.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProvisioningState.java new file mode 100644 index 000000000000..a8f564ef67ff --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProvisioningState.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for OperationProvisioningState. + */ +public final class OperationProvisioningState extends ExpandableStringEnum { + /** + * Static value Unknown for OperationProvisioningState. + */ + public static final OperationProvisioningState UNKNOWN = fromString("Unknown"); + + /** + * Static value InProgress for OperationProvisioningState. + */ + public static final OperationProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for OperationProvisioningState. + */ + public static final OperationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for OperationProvisioningState. + */ + public static final OperationProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for OperationProvisioningState. + */ + public static final OperationProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Pending for OperationProvisioningState. + */ + public static final OperationProvisioningState PENDING = fromString("Pending"); + + /** + * Static value Disabled for OperationProvisioningState. + */ + public static final OperationProvisioningState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of OperationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationProvisioningState() { + } + + /** + * Creates or finds a OperationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationProvisioningState. + */ + @JsonCreator + public static OperationProvisioningState fromString(String name) { + return fromString(name, OperationProvisioningState.class); + } + + /** + * Gets known OperationProvisioningState values. + * + * @return known OperationProvisioningState values. + */ + public static Collection values() { + return values(OperationProvisioningState.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operations.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operations.java index 1b3dd11ab30a..91c34040c7d8 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operations.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Operations.java @@ -7,25 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** - * Lists all of the available NotificationHubs REST API operations. - * + * Lists all available Notification Hubs 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 NotificationHubs operations. + * @return result of the request to list NotificationHubs operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentials.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentials.java new file mode 100644 index 000000000000..8ce8b2217d69 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentials.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Collection of Notification Hub or Notification Hub Namespace PNS credentials. + */ +@Fluent +public final class PnsCredentials { + /* + * Description of a NotificationHub AdmCredential. + */ + @JsonProperty(value = "admCredential") + private AdmCredential admCredential; + + /* + * Description of a NotificationHub ApnsCredential. + */ + @JsonProperty(value = "apnsCredential") + private ApnsCredential apnsCredential; + + /* + * Description of a NotificationHub BaiduCredential. + */ + @JsonProperty(value = "baiduCredential") + private BaiduCredential baiduCredential; + + /* + * Description of a NotificationHub BrowserCredential. + */ + @JsonProperty(value = "browserCredential") + private BrowserCredential browserCredential; + + /* + * Description of a NotificationHub GcmCredential. + */ + @JsonProperty(value = "gcmCredential") + private GcmCredential gcmCredential; + + /* + * Description of a NotificationHub MpnsCredential. + */ + @JsonProperty(value = "mpnsCredential") + private MpnsCredential mpnsCredential; + + /* + * Description of a NotificationHub WnsCredential. + */ + @JsonProperty(value = "wnsCredential") + private WnsCredential wnsCredential; + + /* + * Description of a NotificationHub XiaomiCredential. + */ + @JsonProperty(value = "xiaomiCredential") + private XiaomiCredential xiaomiCredential; + + /* + * Description of a NotificationHub FcmV1Credential. + */ + @JsonProperty(value = "fcmV1Credential") + private FcmV1Credential fcmV1Credential; + + /** + * Creates an instance of PnsCredentials class. + */ + public PnsCredentials() { + } + + /** + * Get the admCredential property: Description of a NotificationHub AdmCredential. + * + * @return the admCredential value. + */ + public AdmCredential admCredential() { + return this.admCredential; + } + + /** + * Set the admCredential property: Description of a NotificationHub AdmCredential. + * + * @param admCredential the admCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withAdmCredential(AdmCredential admCredential) { + this.admCredential = admCredential; + return this; + } + + /** + * Get the apnsCredential property: Description of a NotificationHub ApnsCredential. + * + * @return the apnsCredential value. + */ + public ApnsCredential apnsCredential() { + return this.apnsCredential; + } + + /** + * Set the apnsCredential property: Description of a NotificationHub ApnsCredential. + * + * @param apnsCredential the apnsCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withApnsCredential(ApnsCredential apnsCredential) { + this.apnsCredential = apnsCredential; + return this; + } + + /** + * Get the baiduCredential property: Description of a NotificationHub BaiduCredential. + * + * @return the baiduCredential value. + */ + public BaiduCredential baiduCredential() { + return this.baiduCredential; + } + + /** + * Set the baiduCredential property: Description of a NotificationHub BaiduCredential. + * + * @param baiduCredential the baiduCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withBaiduCredential(BaiduCredential baiduCredential) { + this.baiduCredential = baiduCredential; + return this; + } + + /** + * Get the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @return the browserCredential value. + */ + public BrowserCredential browserCredential() { + return this.browserCredential; + } + + /** + * Set the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @param browserCredential the browserCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withBrowserCredential(BrowserCredential browserCredential) { + this.browserCredential = browserCredential; + return this; + } + + /** + * Get the gcmCredential property: Description of a NotificationHub GcmCredential. + * + * @return the gcmCredential value. + */ + public GcmCredential gcmCredential() { + return this.gcmCredential; + } + + /** + * Set the gcmCredential property: Description of a NotificationHub GcmCredential. + * + * @param gcmCredential the gcmCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withGcmCredential(GcmCredential gcmCredential) { + this.gcmCredential = gcmCredential; + return this; + } + + /** + * Get the mpnsCredential property: Description of a NotificationHub MpnsCredential. + * + * @return the mpnsCredential value. + */ + public MpnsCredential mpnsCredential() { + return this.mpnsCredential; + } + + /** + * Set the mpnsCredential property: Description of a NotificationHub MpnsCredential. + * + * @param mpnsCredential the mpnsCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withMpnsCredential(MpnsCredential mpnsCredential) { + this.mpnsCredential = mpnsCredential; + return this; + } + + /** + * Get the wnsCredential property: Description of a NotificationHub WnsCredential. + * + * @return the wnsCredential value. + */ + public WnsCredential wnsCredential() { + return this.wnsCredential; + } + + /** + * Set the wnsCredential property: Description of a NotificationHub WnsCredential. + * + * @param wnsCredential the wnsCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withWnsCredential(WnsCredential wnsCredential) { + this.wnsCredential = wnsCredential; + return this; + } + + /** + * Get the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @return the xiaomiCredential value. + */ + public XiaomiCredential xiaomiCredential() { + return this.xiaomiCredential; + } + + /** + * Set the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @param xiaomiCredential the xiaomiCredential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withXiaomiCredential(XiaomiCredential xiaomiCredential) { + this.xiaomiCredential = xiaomiCredential; + return this; + } + + /** + * Get the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @return the fcmV1Credential value. + */ + public FcmV1Credential fcmV1Credential() { + return this.fcmV1Credential; + } + + /** + * Set the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @param fcmV1Credential the fcmV1Credential value to set. + * @return the PnsCredentials object itself. + */ + public PnsCredentials withFcmV1Credential(FcmV1Credential fcmV1Credential) { + this.fcmV1Credential = fcmV1Credential; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (admCredential() != null) { + admCredential().validate(); + } + if (apnsCredential() != null) { + apnsCredential().validate(); + } + if (baiduCredential() != null) { + baiduCredential().validate(); + } + if (browserCredential() != null) { + browserCredential().validate(); + } + if (gcmCredential() != null) { + gcmCredential().validate(); + } + if (mpnsCredential() != null) { + mpnsCredential().validate(); + } + if (wnsCredential() != null) { + wnsCredential().validate(); + } + if (xiaomiCredential() != null) { + xiaomiCredential().validate(); + } + if (fcmV1Credential() != null) { + fcmV1Credential().validate(); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentialsResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentialsResource.java index 46ae0fe56a1d..62d78f7bd8d2 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentialsResource.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentialsResource.java @@ -4,98 +4,66 @@ package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner; import java.util.Map; -/** An immutable client-side representation of PnsCredentialsResource. */ +/** + * An immutable client-side representation of PnsCredentialsResource. + */ public interface PnsCredentialsResource { /** * 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. - * + * Gets the properties property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. + * + * @return the properties value. + */ + PnsCredentials properties(); + + /** + * Gets the location property: Deprecated - only for compatibility. + * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. - * + * Gets the tags property: Deprecated - only for compatibility. + * * @return the tags value. */ Map tags(); /** - * Gets the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @return the apnsCredential value. - */ - ApnsCredential apnsCredential(); - - /** - * Gets the wnsCredential property: The WnsCredential of the created NotificationHub. - * - * @return the wnsCredential value. - */ - WnsCredential wnsCredential(); - - /** - * Gets the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @return the gcmCredential value. - */ - GcmCredential gcmCredential(); - - /** - * Gets the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @return the mpnsCredential value. - */ - MpnsCredential mpnsCredential(); - - /** - * Gets the admCredential property: The AdmCredential of the created NotificationHub. - * - * @return the admCredential value. - */ - AdmCredential admCredential(); - - /** - * Gets the baiduCredential property: The BaiduCredential of the created NotificationHub. - * - * @return the baiduCredential value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - BaiduCredential baiduCredential(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner object. - * + * * @return the inner object. */ PnsCredentialsResourceInner innerModel(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyResource.java new file mode 100644 index 000000000000..20e01cc0edd1 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyResource.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace / NotificationHub Regenerate Keys request. + */ +@Fluent +public final class PolicyKeyResource { + /* + * Type of Shared Access Policy Key (primary or secondary). + */ + @JsonProperty(value = "policyKey", required = true) + private PolicyKeyType policyKey; + + /** + * Creates an instance of PolicyKeyResource class. + */ + public PolicyKeyResource() { + } + + /** + * Get the policyKey property: Type of Shared Access Policy Key (primary or secondary). + * + * @return the policyKey value. + */ + public PolicyKeyType policyKey() { + return this.policyKey; + } + + /** + * Set the policyKey property: Type of Shared Access Policy Key (primary or secondary). + * + * @param policyKey the policyKey value to set. + * @return the PolicyKeyResource object itself. + */ + public PolicyKeyResource withPolicyKey(PolicyKeyType policyKey) { + this.policyKey = policyKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyKey() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property policyKey in model PolicyKeyResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyKeyResource.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyType.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyType.java new file mode 100644 index 000000000000..d1716ebc7520 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of Shared Access Policy Key (primary or secondary). + */ +public final class PolicyKeyType extends ExpandableStringEnum { + /** + * Static value PrimaryKey for PolicyKeyType. + */ + public static final PolicyKeyType PRIMARY_KEY = fromString("PrimaryKey"); + + /** + * Static value SecondaryKey for PolicyKeyType. + */ + public static final PolicyKeyType SECONDARY_KEY = fromString("SecondaryKey"); + + /** + * Creates a new instance of PolicyKeyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyKeyType() { + } + + /** + * Creates or finds a PolicyKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyKeyType. + */ + @JsonCreator + public static PolicyKeyType fromString(String name) { + return fromString(name, PolicyKeyType.class); + } + + /** + * Gets known PolicyKeyType values. + * + * @return known PolicyKeyType values. + */ + public static Collection values() { + return values(PolicyKeyType.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicykeyResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicykeyResource.java deleted file mode 100644 index c6c67fbdffb0..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicykeyResource.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Namespace/NotificationHub Regenerate Keys. */ -@Fluent -public final class PolicykeyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicykeyResource.class); - - /* - * Name of the key that has to be regenerated for the - * Namespace/Notification Hub Authorization Rule. The value can be Primary - * Key/Secondary Key. - */ - @JsonProperty(value = "policyKey") - private String policyKey; - - /** - * Get the policyKey property: Name of the key that has to be regenerated for the Namespace/Notification Hub - * Authorization Rule. The value can be Primary Key/Secondary Key. - * - * @return the policyKey value. - */ - public String policyKey() { - return this.policyKey; - } - - /** - * Set the policyKey property: Name of the key that has to be regenerated for the Namespace/Notification Hub - * Authorization Rule. The value can be Primary Key/Secondary Key. - * - * @param policyKey the policyKey value to set. - * @return the PolicykeyResource object itself. - */ - public PolicykeyResource withPolicyKey(String policyKey) { - this.policyKey = policyKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..3dde1f3525c8 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Private Endpoint Connection properties. + */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * State of Private Endpoint Connection. + */ + @JsonProperty(value = "provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /* + * Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint + * Connection. + */ + @JsonProperty(value = "privateEndpoint") + private RemotePrivateEndpointConnection privateEndpoint; + + /* + * List of group ids. For Notification Hubs, it always contains a single "namespace" element. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /* + * State of the Private Link Service connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private RemotePrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the provisioningState property: State of Private Endpoint Connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: State of Private Endpoint Connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the privateEndpoint property: Represents a Private Endpoint that is connected to Notification Hubs namespace + * using Private Endpoint Connection. + * + * @return the privateEndpoint value. + */ + public RemotePrivateEndpointConnection privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Represents a Private Endpoint that is connected to Notification Hubs namespace + * using Private Endpoint Connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(RemotePrivateEndpointConnection privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the groupIds property: List of group ids. For Notification Hubs, it always contains a single "namespace" + * element. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateLinkServiceConnectionState property: State of the Private Link Service connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public RemotePrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: State of the Private Link Service connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + RemotePrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + 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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProvisioningState.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..7ad99e23aa7f --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProvisioningState.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.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * State of Private Endpoint Connection. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Unknown for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState UNKNOWN = fromString("Unknown"); + + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value UpdatingByProxy for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState UPDATING_BY_PROXY = fromString("UpdatingByProxy"); + + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value DeletingByProxy for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING_BY_PROXY = fromString("DeletingByProxy"); + + /** + * Static value Deleted for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETED = fromString("Deleted"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResource.java new file mode 100644 index 000000000000..534d225a1b44 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResource.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.notificationhubs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; + +/** + * An immutable client-side representation of PrivateEndpointConnectionResource. + */ +public interface PrivateEndpointConnectionResource { + /** + * 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 properties property: Private Endpoint Connection properties. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionResourceInner innerModel(); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResourceListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResourceListResult.java new file mode 100644 index 000000000000..0307cdd01be3 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResourceListResult.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.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of the List Private Endpoint Connections operation. + */ +@Immutable +public final class PrivateEndpointConnectionResourceListResult { + /* + * Gets or sets result of the List AuthorizationRules operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Gets or sets link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionResourceListResult class. + */ + public PrivateEndpointConnectionResourceListResult() { + } + + /** + * Get the value property: Gets or sets result of the List AuthorizationRules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Gets or sets link to the next set of results. + * + * @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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..55da61f609d4 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.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.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; + +/** + * Resource collection API of PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + PrivateEndpointConnectionResource update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters); + + /** + * Approves or rejects Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param parameters Description of the Private Endpoint Connection 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 represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + PrivateEndpointConnectionResource update(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context); + + /** + * Deletes the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 the Private Endpoint Connection. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace + * along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context); + + /** + * Returns a Private Endpoint Connection with a given name. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param privateEndpointConnectionName Private Endpoint Connection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Private Endpoint Connection ARM resource - a sub-resource of Notification Hubs namespace. + */ + PrivateEndpointConnectionResource get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName); + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. + * This is a public API that can be called directly by Notification Hubs users. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Endpoint Connections operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName, + Context context); + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "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 a Private Link Arm Resource along with {@link Response}. + */ + Response getGroupIdWithResponse(String resourceGroupName, String namespaceName, + String subResourceName, Context context); + + /** + * Returns Group Id response. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param subResourceName Name of the Private Link sub-resource. The only supported sub-resource is "namespace". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Private Link Arm Resource. + */ + PrivateLinkResource getGroupId(String resourceGroupName, String namespaceName, String subResourceName); + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listGroupIds(String resourceGroupName, String namespaceName); + + /** + * Returns all Group Ids supported by the Notification Hubs RP. + * This is a public API required by the Networking RP contract. It can be used directly by Notification Hubs users. + * + * Even though this namespace requires subscription id, resource group and namespace name, it returns a constant + * payload (for a given namespacE) every time it's called. + * That's why we don't send it to the sibling RP, but process it directly in the scale unit that received the + * request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName 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 response of the List Private Link Resources operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listGroupIds(String resourceGroupName, String namespaceName, Context context); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkConnectionStatus.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkConnectionStatus.java new file mode 100644 index 000000000000..bcd7e1f80008 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkConnectionStatus.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.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * State of Private Link Connection. + */ +public final class PrivateLinkConnectionStatus extends ExpandableStringEnum { + /** + * Static value Disconnected for PrivateLinkConnectionStatus. + */ + public static final PrivateLinkConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * 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"); + + /** + * Creates a new instance of PrivateLinkConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateLinkConnectionStatus() { + } + + /** + * 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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResource.java new file mode 100644 index 000000000000..0790a91cf133 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * 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 properties property: Represents properties of Private Link Resource. + * + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..e0767ca63e0b --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceListResult.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.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of the List Private Link Resources operation. + */ +@Immutable +public final class PrivateLinkResourceListResult { + /* + * Gets or sets result of the List AuthorizationRules operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Gets or sets link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + public PrivateLinkResourceListResult() { + } + + /** + * Get the value property: Gets or sets result of the List AuthorizationRules operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Gets or sets link to the next set of results. + * + * @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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..2ff4c2420bac --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents properties of Private Link Resource. + */ +@Immutable +public final class PrivateLinkResourceProperties { + /* + * A Group Id for Private Link. For Notification Hubs, it is always set to "namespace". + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * Required members. For Notification Hubs, it's always a collection with a single "namespace" item. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names. For Notification Hubs, it contains two CNames for Service Bus and Notification Hubs + * zones. + */ + @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: A Group Id for Private Link. For Notification Hubs, it is always set to "namespace". + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: Required members. For Notification Hubs, it's always a collection with a + * single "namespace" item. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: Required DNS zone names. For Notification Hubs, it contains two CNames for + * Service Bus and Notification Hubs zones. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicInternetAuthorizationRule.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicInternetAuthorizationRule.java new file mode 100644 index 000000000000..bb40711d145d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicInternetAuthorizationRule.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A default (public Internet) network authorization rule, which contains rights if no other network rule matches. + */ +@Fluent +public final class PublicInternetAuthorizationRule { + /* + * List of access rights. + */ + @JsonProperty(value = "rights", required = true) + private List rights; + + /** + * Creates an instance of PublicInternetAuthorizationRule class. + */ + public PublicInternetAuthorizationRule() { + } + + /** + * Get the rights property: List of access rights. + * + * @return the rights value. + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights property: List of access rights. + * + * @param rights the rights value to set. + * @return the PublicInternetAuthorizationRule object itself. + */ + public PublicInternetAuthorizationRule 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 PublicInternetAuthorizationRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PublicInternetAuthorizationRule.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicNetworkAccess.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..1f9415b93f9c --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicNetworkAccess.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of public network access. + */ +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"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * 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/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RegistrationResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RegistrationResult.java new file mode 100644 index 000000000000..83ede8414b09 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RegistrationResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Notification result for a single registration. + */ +@Immutable +public final class RegistrationResult { + /* + * PNS type. + */ + @JsonProperty(value = "applicationPlatform", access = JsonProperty.Access.WRITE_ONLY) + private String applicationPlatform; + + /* + * PNS handle. + */ + @JsonProperty(value = "pnsHandle", access = JsonProperty.Access.WRITE_ONLY) + private String pnsHandle; + + /* + * Registration id. + */ + @JsonProperty(value = "registrationId", access = JsonProperty.Access.WRITE_ONLY) + private String registrationId; + + /* + * Notification outcome. + */ + @JsonProperty(value = "outcome", access = JsonProperty.Access.WRITE_ONLY) + private String outcome; + + /** + * Creates an instance of RegistrationResult class. + */ + public RegistrationResult() { + } + + /** + * Get the applicationPlatform property: PNS type. + * + * @return the applicationPlatform value. + */ + public String applicationPlatform() { + return this.applicationPlatform; + } + + /** + * Get the pnsHandle property: PNS handle. + * + * @return the pnsHandle value. + */ + public String pnsHandle() { + return this.pnsHandle; + } + + /** + * Get the registrationId property: Registration id. + * + * @return the registrationId value. + */ + public String registrationId() { + return this.registrationId; + } + + /** + * Get the outcome property: Notification outcome. + * + * @return the outcome value. + */ + public String outcome() { + return this.outcome; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateEndpointConnection.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateEndpointConnection.java new file mode 100644 index 000000000000..019caed130fb --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateEndpointConnection.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.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint Connection. + */ +@Immutable +public final class RemotePrivateEndpointConnection { + /* + * ARM resource ID of the Private Endpoint. This may belong to different subscription and resource group than a + * Notification Hubs namespace. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Creates an instance of RemotePrivateEndpointConnection class. + */ + public RemotePrivateEndpointConnection() { + } + + /** + * Get the id property: ARM resource ID of the Private Endpoint. This may belong to different subscription and + * resource group than a Notification Hubs namespace. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateLinkServiceConnectionState.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..80672d299a40 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateLinkServiceConnectionState.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * State of the Private Link Service connection. + */ +@Fluent +public final class RemotePrivateLinkServiceConnectionState { + /* + * State of Private Link Connection. + */ + @JsonProperty(value = "status") + private PrivateLinkConnectionStatus status; + + /* + * Human-friendly description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Human-friendly description of required actions. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Creates an instance of RemotePrivateLinkServiceConnectionState class. + */ + public RemotePrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: State of Private Link Connection. + * + * @return the status value. + */ + public PrivateLinkConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: State of Private Link Connection. + * + * @param status the status value to set. + * @return the RemotePrivateLinkServiceConnectionState object itself. + */ + public RemotePrivateLinkServiceConnectionState withStatus(PrivateLinkConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: Human-friendly description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the actionsRequired property: Human-friendly description of required actions. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ReplicationRegion.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ReplicationRegion.java new file mode 100644 index 000000000000..9a3a0a161198 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ReplicationRegion.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.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Allowed replication region. + */ +public final class ReplicationRegion extends ExpandableStringEnum { + /** + * Static value Default for ReplicationRegion. + */ + public static final ReplicationRegion DEFAULT = fromString("Default"); + + /** + * Static value WestUs2 for ReplicationRegion. + */ + public static final ReplicationRegion WEST_US2 = fromString("WestUs2"); + + /** + * Static value NorthEurope for ReplicationRegion. + */ + public static final ReplicationRegion NORTH_EUROPE = fromString("NorthEurope"); + + /** + * Static value AustraliaEast for ReplicationRegion. + */ + public static final ReplicationRegion AUSTRALIA_EAST = fromString("AustraliaEast"); + + /** + * Static value BrazilSouth for ReplicationRegion. + */ + public static final ReplicationRegion BRAZIL_SOUTH = fromString("BrazilSouth"); + + /** + * Static value SouthEastAsia for ReplicationRegion. + */ + public static final ReplicationRegion SOUTH_EAST_ASIA = fromString("SouthEastAsia"); + + /** + * Static value SouthAfricaNorth for ReplicationRegion. + */ + public static final ReplicationRegion SOUTH_AFRICA_NORTH = fromString("SouthAfricaNorth"); + + /** + * Static value None for ReplicationRegion. + */ + public static final ReplicationRegion NONE = fromString("None"); + + /** + * Creates a new instance of ReplicationRegion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationRegion() { + } + + /** + * Creates or finds a ReplicationRegion from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationRegion. + */ + @JsonCreator + public static ReplicationRegion fromString(String name) { + return fromString(name, ReplicationRegion.class); + } + + /** + * Gets known ReplicationRegion values. + * + * @return known ReplicationRegion values. + */ + public static Collection values() { + return values(ReplicationRegion.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ResourceListKeys.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ResourceListKeys.java index dbabd59400fb..40299e86115d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ResourceListKeys.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ResourceListKeys.java @@ -6,46 +6,49 @@ import com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner; -/** An immutable client-side representation of ResourceListKeys. */ +/** + * An immutable client-side representation of ResourceListKeys. + */ public interface ResourceListKeys { /** - * Gets the primaryConnectionString property: PrimaryConnectionString of the AuthorizationRule. - * + * Gets the primaryConnectionString property: Gets or sets primaryConnectionString of the AuthorizationRule. + * * @return the primaryConnectionString value. */ String primaryConnectionString(); /** - * Gets the secondaryConnectionString property: SecondaryConnectionString of the created AuthorizationRule. - * + * Gets the secondaryConnectionString property: Gets or sets secondaryConnectionString of the created + * AuthorizationRule. + * * @return the secondaryConnectionString value. */ String secondaryConnectionString(); /** - * Gets the primaryKey property: PrimaryKey of the created AuthorizationRule. - * + * Gets the primaryKey property: Gets or sets primaryKey of the created AuthorizationRule. + * * @return the primaryKey value. */ String primaryKey(); /** - * Gets the secondaryKey property: SecondaryKey of the created AuthorizationRule. - * + * Gets the secondaryKey property: Gets or sets secondaryKey of the created AuthorizationRule. + * * @return the secondaryKey value. */ String secondaryKey(); /** - * Gets the keyName property: KeyName of the created AuthorizationRule. - * + * Gets the keyName property: Gets or sets keyName of the created AuthorizationRule. + * * @return the keyName value. */ String keyName(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner object. - * + * * @return the inner object. */ ResourceListKeysInner innerModel(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ServiceSpecification.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ServiceSpecification.java new file mode 100644 index 000000000000..d4b1204deb82 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ServiceSpecification.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Optional service specification used in Operations API. + */ +@Immutable +public final class ServiceSpecification { + /* + * Log specifications. + */ + @JsonProperty(value = "logSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List logSpecifications; + + /* + * Metric specification. + */ + @JsonProperty(value = "metricSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List metricSpecifications; + + /** + * Creates an instance of ServiceSpecification class. + */ + public ServiceSpecification() { + } + + /** + * Get the logSpecifications property: Log specifications. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Get the metricSpecifications property: Metric specification. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java deleted file mode 100644 index 9d9b09ab72c0..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. */ -@Fluent -public final class SharedAccessAuthorizationRuleCreateOrUpdateParameters { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(SharedAccessAuthorizationRuleCreateOrUpdateParameters.class); - - /* - * Properties of the Namespace AuthorizationRules. - */ - @JsonProperty(value = "properties", required = true) - private SharedAccessAuthorizationRuleProperties properties; - - /** - * Get the properties property: Properties of the Namespace AuthorizationRules. - * - * @return the properties value. - */ - public SharedAccessAuthorizationRuleProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the Namespace AuthorizationRules. - * - * @param properties the properties value to set. - * @return the SharedAccessAuthorizationRuleCreateOrUpdateParameters object itself. - */ - public SharedAccessAuthorizationRuleCreateOrUpdateParameters withProperties( - SharedAccessAuthorizationRuleProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model" - + " SharedAccessAuthorizationRuleCreateOrUpdateParameters")); - } else { - properties().validate(); - } - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleListResult.java index 7e3d4eb561df..e8c96ae9ea2c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleListResult.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleListResult.java @@ -4,76 +4,55 @@ package com.azure.resourcemanager.notificationhubs.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of the List Namespace operation. */ -@Fluent +/** + * The response of the List Namespace operation. + */ +@Immutable public final class SharedAccessAuthorizationRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedAccessAuthorizationRuleListResult.class); - /* - * Result of the List AuthorizationRules operation. + * Gets or sets result of the List AuthorizationRules operation. */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete - * list of AuthorizationRules + * Gets or sets link to the next set of results. */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: Result of the List AuthorizationRules operation. - * - * @return the value value. + * Creates an instance of SharedAccessAuthorizationRuleListResult class. */ - public List value() { - return this.value; + public SharedAccessAuthorizationRuleListResult() { } /** - * Set the value property: Result of the List AuthorizationRules operation. - * - * @param value the value value to set. - * @return the SharedAccessAuthorizationRuleListResult object itself. + * Get the value property: Gets or sets result of the List AuthorizationRules operation. + * + * @return the value value. */ - public SharedAccessAuthorizationRuleListResult withValue(List value) { - this.value = value; - return this; + public List value() { + return this.value; } /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * AuthorizationRules. - * + * Get the nextLink property: Gets or sets link to the next set of results. + * * @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 - * AuthorizationRules. - * - * @param nextLink the nextLink value to set. - * @return the SharedAccessAuthorizationRuleListResult object itself. - */ - public SharedAccessAuthorizationRuleListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleProperties.java new file mode 100644 index 000000000000..4a3a6b68a463 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleProperties.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * SharedAccessAuthorizationRule properties. + */ +@Fluent +public final class SharedAccessAuthorizationRuleProperties { + /* + * Gets or sets the rights associated with the rule. + */ + @JsonProperty(value = "rights", required = true) + private List rights; + + /* + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /* + * Gets a string that describes the authorization rule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /* + * Gets the last modified time for this rule + */ + @JsonProperty(value = "modifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime modifiedTime; + + /* + * Gets the created time for this rule + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Gets a string that describes the claim type + */ + @JsonProperty(value = "claimType", access = JsonProperty.Access.WRITE_ONLY) + private String claimType; + + /* + * Gets a string that describes the claim value + */ + @JsonProperty(value = "claimValue", access = JsonProperty.Access.WRITE_ONLY) + private String claimValue; + + /* + * Gets the revision number for the rule + */ + @JsonProperty(value = "revision", access = JsonProperty.Access.WRITE_ONLY) + private Integer revision; + + /** + * Creates an instance of SharedAccessAuthorizationRuleProperties class. + */ + public SharedAccessAuthorizationRuleProperties() { + } + + /** + * Get the rights property: Gets or sets the rights associated with the rule. + * + * @return the rights value. + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights property: Gets or sets the rights associated with the rule. + * + * @param rights the rights value to set. + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Get the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * + * @param primaryKey the primaryKey value to set. + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * + * @param secondaryKey the secondaryKey value to set. + * @return the SharedAccessAuthorizationRuleProperties object itself. + */ + public SharedAccessAuthorizationRuleProperties withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the keyName property: Gets a string that describes the authorization rule. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Get the modifiedTime property: Gets the last modified time for this rule. + * + * @return the modifiedTime value. + */ + public OffsetDateTime modifiedTime() { + return this.modifiedTime; + } + + /** + * Get the createdTime property: Gets the created time for this rule. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the claimType property: Gets a string that describes the claim type. + * + * @return the claimType value. + */ + public String claimType() { + return this.claimType; + } + + /** + * Get the claimValue property: Gets a string that describes the claim value. + * + * @return the claimValue value. + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Get the revision property: Gets the revision number for the rule. + * + * @return the revision value. + */ + public Integer revision() { + return this.revision; + } + + /** + * 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 SharedAccessAuthorizationRuleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SharedAccessAuthorizationRuleProperties.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleResource.java index 8653e9598efd..65cbffe19c64 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleResource.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleResource.java @@ -6,287 +6,310 @@ 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.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; -import java.util.List; import java.util.Map; -/** An immutable client-side representation of SharedAccessAuthorizationRuleResource. */ +/** + * An immutable client-side representation of SharedAccessAuthorizationRuleResource. + */ public interface SharedAccessAuthorizationRuleResource { /** * 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. - * + * Gets the properties property: SharedAccessAuthorizationRule properties. + * + * @return the properties value. + */ + SharedAccessAuthorizationRuleProperties properties(); + + /** + * Gets the location property: Deprecated - only for compatibility. + * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. - * + * Gets the tags property: Deprecated - only for compatibility. + * * @return the tags value. */ Map tags(); /** - * Gets the sku property: The sku of the created namespace. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the rights property: The rights associated with the rule. - * - * @return the rights value. - */ - List rights(); - - /** - * 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 claimType property: A string that describes the claim type. - * - * @return the claimType value. - */ - String claimType(); - - /** - * Gets the claimValue property: A string that describes the claim value. - * - * @return the claimValue value. - */ - String claimValue(); - - /** - * Gets the modifiedTime property: The last modified time for this rule. - * - * @return the modifiedTime value. - */ - String modifiedTime(); - - /** - * Gets the createdTime property: The created time for this rule. - * - * @return the createdTime value. - */ - String createdTime(); - - /** - * Gets the revision property: The revision number for the rule. - * - * @return the revision value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - Integer revision(); + SystemData systemData(); /** * 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.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner object. - * + * * @return the inner object. */ SharedAccessAuthorizationRuleResourceInner innerModel(); - /** The entirety of the SharedAccessAuthorizationRuleResource definition. */ + /** + * The entirety of the SharedAccessAuthorizationRuleResource definition. + */ interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The SharedAccessAuthorizationRuleResource definition stages. */ + + /** + * The SharedAccessAuthorizationRuleResource definition stages. + */ interface DefinitionStages { - /** The first stage of the SharedAccessAuthorizationRuleResource definition. */ + /** + * The first stage of the SharedAccessAuthorizationRuleResource definition. + */ interface Blank extends WithParentResource { } - /** The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify parent resource. */ + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, namespaceName. - * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * Specifies resourceGroupName, namespaceName, notificationHubName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName Namespace name. + * @param notificationHubName Notification Hub name. * @return the next definition stage. */ - WithProperties withExistingNamespace(String resourceGroupName, String namespaceName); - } - /** The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify properties. */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the Namespace AuthorizationRules.. - * - * @param properties Properties of the Namespace AuthorizationRules. - * @return the next definition stage. - */ - WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + WithCreate withExistingNotificationHub(String resourceGroupName, String namespaceName, + String notificationHubName); } + /** * The stage of the SharedAccessAuthorizationRuleResource 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 { + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ SharedAccessAuthorizationRuleResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ SharedAccessAuthorizationRuleResource create(Context context); } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Deprecated - only for compatibility. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Deprecated - only for compatibility. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Deprecated - only for compatibility.. + * + * @param tags Deprecated - only for compatibility. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: SharedAccessAuthorizationRule properties.. + * + * @param properties SharedAccessAuthorizationRule properties. + * @return the next definition stage. + */ + WithCreate withProperties(SharedAccessAuthorizationRuleProperties properties); + } } + /** * Begins update for the SharedAccessAuthorizationRuleResource resource. - * + * * @return the stage of resource update. */ SharedAccessAuthorizationRuleResource.Update update(); - /** The template for SharedAccessAuthorizationRuleResource update. */ - interface Update extends UpdateStages.WithProperties { + /** + * The template for SharedAccessAuthorizationRuleResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ SharedAccessAuthorizationRuleResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ SharedAccessAuthorizationRuleResource apply(Context context); } - /** The SharedAccessAuthorizationRuleResource update stages. */ + + /** + * The SharedAccessAuthorizationRuleResource update stages. + */ interface UpdateStages { - /** The stage of the SharedAccessAuthorizationRuleResource update allowing to specify properties. */ + /** + * The stage of the SharedAccessAuthorizationRuleResource update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Deprecated - only for compatibility.. + * + * @param tags Deprecated - only for compatibility. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource update allowing to specify properties. + */ interface WithProperties { /** - * Specifies the properties property: Properties of the Namespace AuthorizationRules.. - * - * @param properties Properties of the Namespace AuthorizationRules. + * Specifies the properties property: SharedAccessAuthorizationRule properties.. + * + * @param properties SharedAccessAuthorizationRule properties. * @return the next definition stage. */ Update withProperties(SharedAccessAuthorizationRuleProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ SharedAccessAuthorizationRuleResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ SharedAccessAuthorizationRuleResource refresh(Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. - * + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub along with {@link Response}. */ - ResourceListKeys listKeys(); + Response listKeysWithResponse(Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub. + * * @throws com.azure.core.management.exception.ManagementException 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 ConnectionStrings to the namespace. + * @return the Primary and Secondary ConnectionStrings to the NotificationHub. */ - Response listKeysWithResponse(Context context); + ResourceListKeys listKeys(); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param parameters Request content. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ - ResourceListKeys regenerateKeys(PolicykeyResource parameters); + Response regenerateKeysWithResponse(PolicyKeyResource parameters, Context context); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. - * - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. - * @param context The context to associate with this operation. + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule. + * + * @param parameters Request content. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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/NotificationHub Connection String. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ - Response regenerateKeysWithResponse(PolicykeyResource parameters, Context context); + ResourceListKeys regenerateKeys(PolicyKeyResource parameters); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Sku.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Sku.java index edbd09c6138c..eb9fe8a85e09 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Sku.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Sku.java @@ -6,47 +6,52 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Sku description for a namespace. */ +/** + * The Sku description for a namespace. + */ @Fluent public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - /* - * Name of the notification hub sku + * Namespace SKU name. */ @JsonProperty(value = "name", required = true) private SkuName name; /* - * The tier of particular sku + * Gets or sets the tier of particular sku */ @JsonProperty(value = "tier") private String tier; /* - * The Sku size + * Gets or sets the Sku size */ @JsonProperty(value = "size") private String size; /* - * The Sku Family + * Gets or sets the Sku Family */ @JsonProperty(value = "family") private String family; /* - * The capacity of the resource + * Gets or sets the capacity of the resource */ @JsonProperty(value = "capacity") private Integer capacity; /** - * Get the name property: Name of the notification hub sku. - * + * Creates an instance of Sku class. + */ + public Sku() { + } + + /** + * Get the name property: Namespace SKU name. + * * @return the name value. */ public SkuName name() { @@ -54,8 +59,8 @@ public SkuName name() { } /** - * Set the name property: Name of the notification hub sku. - * + * Set the name property: Namespace SKU name. + * * @param name the name value to set. * @return the Sku object itself. */ @@ -65,8 +70,8 @@ public Sku withName(SkuName name) { } /** - * Get the tier property: The tier of particular sku. - * + * Get the tier property: Gets or sets the tier of particular sku. + * * @return the tier value. */ public String tier() { @@ -74,8 +79,8 @@ public String tier() { } /** - * Set the tier property: The tier of particular sku. - * + * Set the tier property: Gets or sets the tier of particular sku. + * * @param tier the tier value to set. * @return the Sku object itself. */ @@ -85,8 +90,8 @@ public Sku withTier(String tier) { } /** - * Get the size property: The Sku size. - * + * Get the size property: Gets or sets the Sku size. + * * @return the size value. */ public String size() { @@ -94,8 +99,8 @@ public String size() { } /** - * Set the size property: The Sku size. - * + * Set the size property: Gets or sets the Sku size. + * * @param size the size value to set. * @return the Sku object itself. */ @@ -105,8 +110,8 @@ public Sku withSize(String size) { } /** - * Get the family property: The Sku Family. - * + * Get the family property: Gets or sets the Sku Family. + * * @return the family value. */ public String family() { @@ -114,8 +119,8 @@ public String family() { } /** - * Set the family property: The Sku Family. - * + * Set the family property: Gets or sets the Sku Family. + * * @param family the family value to set. * @return the Sku object itself. */ @@ -125,8 +130,8 @@ public Sku withFamily(String family) { } /** - * Get the capacity property: The capacity of the resource. - * + * Get the capacity property: Gets or sets the capacity of the resource. + * * @return the capacity value. */ public Integer capacity() { @@ -134,8 +139,8 @@ public Integer capacity() { } /** - * Set the capacity property: The capacity of the resource. - * + * Set the capacity property: Gets or sets the capacity of the resource. + * * @param capacity the capacity value to set. * @return the Sku object itself. */ @@ -146,13 +151,15 @@ public Sku withCapacity(Integer capacity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SkuName.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SkuName.java index 34611409d6d4..1110459cfa3c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SkuName.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SkuName.java @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SkuName. */ +/** + * Namespace SKU name. + */ public final class SkuName extends ExpandableStringEnum { - /** Static value Free for SkuName. */ + /** + * Static value Free for SkuName. + */ public static final SkuName FREE = fromString("Free"); - /** Static value Basic for SkuName. */ + /** + * Static value Basic for SkuName. + */ public static final SkuName BASIC = fromString("Basic"); - /** Static value Standard for SkuName. */ + /** + * Static value Standard for SkuName. + */ public static final SkuName STANDARD = fromString("Standard"); + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + /** * Creates or finds a SkuName from its string representation. - * + * * @param name a name to look for. * @return the corresponding SkuName. */ @@ -30,7 +47,11 @@ public static SkuName fromString(String name) { return fromString(name, SkuName.class); } - /** @return known SkuName values. */ + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ public static Collection values() { return values(SkuName.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredential.java index 2c7f1b9f1dcd..05af045ff5f5 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredential.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredential.java @@ -6,107 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.notificationhubs.fluent.models.WnsCredentialProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Description of a NotificationHub WnsCredential. */ +/** + * Description of a NotificationHub WnsCredential. + */ @Fluent public final class WnsCredential { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WnsCredential.class); - /* - * Properties of NotificationHub WnsCredential. + * Description of a NotificationHub WnsCredential. */ - @JsonProperty(value = "properties") - private WnsCredentialProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private WnsCredentialProperties properties; /** - * Get the innerProperties property: Properties of NotificationHub WnsCredential. - * - * @return the innerProperties value. + * Creates an instance of WnsCredential class. */ - private WnsCredentialProperties innerProperties() { - return this.innerProperties; + public WnsCredential() { } /** - * Get the packageSid property: The package ID for this credential. - * - * @return the packageSid value. + * Get the properties property: Description of a NotificationHub WnsCredential. + * + * @return the properties value. */ - public String packageSid() { - return this.innerProperties() == null ? null : this.innerProperties().packageSid(); + public WnsCredentialProperties properties() { + return this.properties; } /** - * Set the packageSid property: The package ID for this credential. - * - * @param packageSid the packageSid value to set. + * Set the properties property: Description of a NotificationHub WnsCredential. + * + * @param properties the properties value to set. * @return the WnsCredential object itself. */ - public WnsCredential withPackageSid(String packageSid) { - if (this.innerProperties() == null) { - this.innerProperties = new WnsCredentialProperties(); - } - this.innerProperties().withPackageSid(packageSid); - return this; - } - - /** - * Get the secretKey property: The secret key. - * - * @return the secretKey value. - */ - public String secretKey() { - return this.innerProperties() == null ? null : this.innerProperties().secretKey(); - } - - /** - * Set the secretKey property: The secret key. - * - * @param secretKey the secretKey value to set. - * @return the WnsCredential object itself. - */ - public WnsCredential withSecretKey(String secretKey) { - if (this.innerProperties() == null) { - this.innerProperties = new WnsCredentialProperties(); - } - this.innerProperties().withSecretKey(secretKey); - return this; - } - - /** - * Get the windowsLiveEndpoint property: The Windows Live endpoint. - * - * @return the windowsLiveEndpoint value. - */ - public String windowsLiveEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().windowsLiveEndpoint(); - } - - /** - * Set the windowsLiveEndpoint property: The Windows Live endpoint. - * - * @param windowsLiveEndpoint the windowsLiveEndpoint value to set. - * @return the WnsCredential object itself. - */ - public WnsCredential withWindowsLiveEndpoint(String windowsLiveEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new WnsCredentialProperties(); - } - this.innerProperties().withWindowsLiveEndpoint(windowsLiveEndpoint); + public WnsCredential withProperties(WnsCredentialProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model WnsCredential")); + } else { + properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(WnsCredential.class); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredentialProperties.java new file mode 100644 index 000000000000..a9bdc65a4c99 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredentialProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub WnsCredential. + */ +@Fluent +public final class WnsCredentialProperties { + /* + * Gets or sets the package ID for this credential. + */ + @JsonProperty(value = "packageSid") + private String packageSid; + + /* + * Gets or sets the secret key. + */ + @JsonProperty(value = "secretKey") + private String secretKey; + + /* + * Gets or sets the Windows Live endpoint. + */ + @JsonProperty(value = "windowsLiveEndpoint") + private String windowsLiveEndpoint; + + /* + * Ges or sets the WNS Certificate Key. + */ + @JsonProperty(value = "certificateKey") + private String certificateKey; + + /* + * Gets or sets the WNS Certificate. + */ + @JsonProperty(value = "wnsCertificate") + private String wnsCertificate; + + /** + * Creates an instance of WnsCredentialProperties class. + */ + public WnsCredentialProperties() { + } + + /** + * Get the packageSid property: Gets or sets the package ID for this credential. + * + * @return the packageSid value. + */ + public String packageSid() { + return this.packageSid; + } + + /** + * Set the packageSid property: Gets or sets the package ID for this credential. + * + * @param packageSid the packageSid value to set. + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withPackageSid(String packageSid) { + this.packageSid = packageSid; + return this; + } + + /** + * Get the secretKey property: Gets or sets the secret key. + * + * @return the secretKey value. + */ + public String secretKey() { + return this.secretKey; + } + + /** + * Set the secretKey property: Gets or sets the secret key. + * + * @param secretKey the secretKey value to set. + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + /** + * Get the windowsLiveEndpoint property: Gets or sets the Windows Live endpoint. + * + * @return the windowsLiveEndpoint value. + */ + public String windowsLiveEndpoint() { + return this.windowsLiveEndpoint; + } + + /** + * Set the windowsLiveEndpoint property: Gets or sets the Windows Live endpoint. + * + * @param windowsLiveEndpoint the windowsLiveEndpoint value to set. + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withWindowsLiveEndpoint(String windowsLiveEndpoint) { + this.windowsLiveEndpoint = windowsLiveEndpoint; + return this; + } + + /** + * Get the certificateKey property: Ges or sets the WNS Certificate Key. + * + * @return the certificateKey value. + */ + public String certificateKey() { + return this.certificateKey; + } + + /** + * Set the certificateKey property: Ges or sets the WNS Certificate Key. + * + * @param certificateKey the certificateKey value to set. + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withCertificateKey(String certificateKey) { + this.certificateKey = certificateKey; + return this; + } + + /** + * Get the wnsCertificate property: Gets or sets the WNS Certificate. + * + * @return the wnsCertificate value. + */ + public String wnsCertificate() { + return this.wnsCertificate; + } + + /** + * Set the wnsCertificate property: Gets or sets the WNS Certificate. + * + * @param wnsCertificate the wnsCertificate value to set. + * @return the WnsCredentialProperties object itself. + */ + public WnsCredentialProperties withWnsCertificate(String wnsCertificate) { + this.wnsCertificate = wnsCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredential.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredential.java new file mode 100644 index 000000000000..13cefd26b5f2 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredential.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub XiaomiCredential. + */ +@Fluent +public final class XiaomiCredential { + /* + * Description of a NotificationHub XiaomiCredentialProperties. + */ + @JsonProperty(value = "properties", required = true) + private XiaomiCredentialProperties properties; + + /** + * Creates an instance of XiaomiCredential class. + */ + public XiaomiCredential() { + } + + /** + * Get the properties property: Description of a NotificationHub XiaomiCredentialProperties. + * + * @return the properties value. + */ + public XiaomiCredentialProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Description of a NotificationHub XiaomiCredentialProperties. + * + * @param properties the properties value to set. + * @return the XiaomiCredential object itself. + */ + public XiaomiCredential withProperties(XiaomiCredentialProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model XiaomiCredential")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(XiaomiCredential.class); +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredentialProperties.java new file mode 100644 index 000000000000..1267ad5797e0 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredentialProperties.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.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a NotificationHub XiaomiCredentialProperties. + */ +@Fluent +public final class XiaomiCredentialProperties { + /* + * Gets or sets app secret. + */ + @JsonProperty(value = "appSecret") + private String appSecret; + + /* + * Gets or sets xiaomi service endpoint. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /** + * Creates an instance of XiaomiCredentialProperties class. + */ + public XiaomiCredentialProperties() { + } + + /** + * Get the appSecret property: Gets or sets app secret. + * + * @return the appSecret value. + */ + public String appSecret() { + return this.appSecret; + } + + /** + * Set the appSecret property: Gets or sets app secret. + * + * @param appSecret the appSecret value to set. + * @return the XiaomiCredentialProperties object itself. + */ + public XiaomiCredentialProperties withAppSecret(String appSecret) { + this.appSecret = appSecret; + return this; + } + + /** + * Get the endpoint property: Gets or sets xiaomi service endpoint. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: Gets or sets xiaomi service endpoint. + * + * @param endpoint the endpoint value to set. + * @return the XiaomiCredentialProperties object itself. + */ + public XiaomiCredentialProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ZoneRedundancyPreference.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ZoneRedundancyPreference.java new file mode 100644 index 000000000000..c3a15a4c6845 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ZoneRedundancyPreference.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Namespace SKU name. + */ +public final class ZoneRedundancyPreference extends ExpandableStringEnum { + /** + * Static value Disabled for ZoneRedundancyPreference. + */ + public static final ZoneRedundancyPreference DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ZoneRedundancyPreference. + */ + public static final ZoneRedundancyPreference ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ZoneRedundancyPreference value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZoneRedundancyPreference() { + } + + /** + * Creates or finds a ZoneRedundancyPreference from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneRedundancyPreference. + */ + @JsonCreator + public static ZoneRedundancyPreference fromString(String name) { + return fromString(name, ZoneRedundancyPreference.class); + } + + /** + * Gets known ZoneRedundancyPreference values. + * + * @return known ZoneRedundancyPreference values. + */ + public static Collection values() { + return values(ZoneRedundancyPreference.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/package-info.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/package-info.java index c61811367b57..fed443315409 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/package-info.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for NotificationHubsManagementClient. Azure NotificationHub client. */ +/** + * Package containing the data models for NotificationHubsRPClient. + * Microsoft Notification Hubs Resource Provider REST API. + */ package com.azure.resourcemanager.notificationhubs.models; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/package-info.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/package-info.java index d6c16347032e..b6ff59b7fa0e 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/package-info.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for NotificationHubsManagementClient. Azure NotificationHub client. */ +/** + * Package containing the classes for NotificationHubsRPClient. + * Microsoft Notification Hubs Resource Provider REST API. + */ package com.azure.resourcemanager.notificationhubs; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/module-info.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/module-info.java index 3e0c96d01782..156c99d08fbc 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/module-info.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.notificationhubs { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.notificationhubs; exports com.azure.resourcemanager.notificationhubs.fluent; exports com.azure.resourcemanager.notificationhubs.fluent.models; exports com.azure.resourcemanager.notificationhubs.models; - - opens com.azure.resourcemanager.notificationhubs.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.notificationhubs.models to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.notificationhubs.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.notificationhubs.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-notificationhubs/proxy-config.json b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-notificationhubs/proxy-config.json new file mode 100644 index 000000000000..410d81d5d239 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-notificationhubs/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsClientImpl$NotificationHubsService" ], [ "com.azure.resourcemanager.notificationhubs.implementation.NamespacesClientImpl$NamespacesService" ], [ "com.azure.resourcemanager.notificationhubs.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.notificationhubs.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ] ] \ No newline at end of file diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-notificationhubs/reflect-config.json b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-notificationhubs/reflect-config.json new file mode 100644 index 000000000000..e95b238989e1 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-notificationhubs/reflect-config.json @@ -0,0 +1,346 @@ +[ { + "name" : "com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.Sku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.ApnsCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.ApnsCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.WnsCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.WnsCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.GcmCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.GcmCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.MpnsCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.MpnsCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.AdmCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.AdmCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.BaiduCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.BaiduCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.BrowserCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.BrowserCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.XiaomiCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.XiaomiCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.FcmV1Credential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.FcmV1CredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NotificationHubPatchParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NotificationHubListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.DebugSendResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.RegistrationResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PnsCredentials", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NamespaceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NetworkAcls", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.IpRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PublicInternetAuthorizationRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NamespaceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.OperationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.ServiceSpecification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.LogSpecification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.MetricSpecification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.Availability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResourceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.SkuName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.AccessRights", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PolicyKeyType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.OperationProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NamespaceStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.NamespaceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.ReplicationRegion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.notificationhubs.models.PublicNetworkAccess", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilitySamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilitySamples.java index 4d7053e87bcd..6ebb0400a4e8 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilitySamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilitySamples.java @@ -4,24 +4,25 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -/** Samples for Namespaces CheckAvailability. */ +/** + * Samples for Namespaces CheckAvailability. + */ public final class NamespacesCheckAvailabilitySamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/CheckAvailability.json */ /** - * Sample code: NameSpaceCheckNameAvailability. - * + * Sample code: Namespaces_CheckAvailability. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceCheckNameAvailability( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .checkAvailabilityWithResponse( - new CheckAvailabilityParameters().withName("sdk-Namespace-2924"), Context.NONE); + public static void + namespacesCheckAvailability(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().checkAvailabilityWithResponse( + new CheckAvailabilityParameters().withName("sdk-Namespace-2924"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java index 41ba40f3f1e9..6474b7b1f92d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java @@ -4,29 +4,31 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; +import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties; import java.util.Arrays; -/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ +/** + * Samples for Namespaces CreateOrUpdateAuthorizationRule. + */ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleCreateOrUpdate.json */ /** - * Sample code: NameSpaceAuthorizationRuleCreate. - * + * Sample code: Namespaces_CreateOrUpdateAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleCreate( + public static void namespacesCreateOrUpdateAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .defineAuthorizationRule("sdk-AuthRules-1788") - .withExistingNamespace("5ktrial", "nh-sdk-ns") - .withProperties( - new SharedAccessAuthorizationRuleProperties() - .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))) - .create(); + manager.namespaces().createOrUpdateAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "sdk-AuthRules-1788", + new SharedAccessAuthorizationRuleResourceInner() + .withProperties(new SharedAccessAuthorizationRuleProperties() + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateSamples.java index b22ad02306f3..cb01df52be63 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateSamples.java @@ -4,32 +4,48 @@ package com.azure.resourcemanager.notificationhubs.generated; +import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.IpRule; +import com.azure.resourcemanager.notificationhubs.models.NamespaceProperties; +import com.azure.resourcemanager.notificationhubs.models.NetworkAcls; +import com.azure.resourcemanager.notificationhubs.models.PublicInternetAuthorizationRule; import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.SkuName; +import com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Namespaces CreateOrUpdate. */ +/** + * Samples for Namespaces CreateOrUpdate. + */ public final class NamespacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/CreateOrUpdate.json */ /** - * Sample code: NameSpaceCreate. - * + * Sample code: Namespaces_CreateOrUpdate. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceCreate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .define("nh-sdk-ns") - .withLocation("South Central US") - .withExistingResourceGroup("5ktrial") + public static void + namespacesCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().define("nh-sdk-ns").withRegion("South Central US").withExistingResourceGroup("5ktrial") + .withSku( + new Sku().withName(SkuName.STANDARD).withTier("Standard")) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + .withProperties(new NamespaceProperties().withZoneRedundancy(ZoneRedundancyPreference.ENABLED) + .withNetworkAcls(new NetworkAcls() + .withIpRules(Arrays.asList(new IpRule().withIpMask("185.48.100.00/24") + .withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.SEND, AccessRights.LISTEN)))) + .withPublicNetworkRule( + new PublicInternetAuthorizationRule().withRights(Arrays.asList(AccessRights.LISTEN))))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java index 13779f27f8ee..89d2a55cb921 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java @@ -4,22 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces DeleteAuthorizationRule. */ +/** + * Samples for Namespaces DeleteAuthorizationRule. + */ public final class NamespacesDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleDelete.json */ /** - * Sample code: NameSpaceAuthorizationRuleDelete. - * + * Sample code: Namespaces_DeleteAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleDelete( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", Context.NONE); + public static void + namespacesDeleteAuthorizationRule(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteSamples.java index 818b8668a887..5d49ea066f70 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces Delete. */ +/** + * Samples for Namespaces Delete. + */ public final class NamespacesDeleteSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/Delete.json */ /** - * Sample code: NameSpaceDelete. - * + * Sample code: Namespaces_Delete. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().delete("5ktrial", "nh-sdk-ns", Context.NONE); + public static void namespacesDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().deleteByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetAuthorizationRuleSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetAuthorizationRuleSamples.java index 2826567ef50d..0f2095d97d87 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetAuthorizationRuleSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetAuthorizationRuleSamples.java @@ -4,22 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces GetAuthorizationRule. */ +/** + * Samples for Namespaces GetAuthorizationRule. + */ public final class NamespacesGetAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleGet.json */ /** - * Sample code: NameSpaceAuthorizationRuleGet. - * + * Sample code: Namespaces_GetAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleGet( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", Context.NONE); + public static void + namespacesGetAuthorizationRule(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupSamples.java index 94cfca12c92b..2bc963e74879 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces GetByResourceGroup. */ +/** + * Samples for Namespaces GetByResourceGroup. + */ public final class NamespacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/Get.json */ /** - * Sample code: NameSpaceGet. - * + * Sample code: Namespaces_Get. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", Context.NONE); + public static void namespacesGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetPnsCredentialsSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetPnsCredentialsSamples.java new file mode 100644 index 000000000000..e27e3eda7ce3 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetPnsCredentialsSamples.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.notificationhubs.generated; + +/** + * Samples for Namespaces GetPnsCredentials. + */ +public final class NamespacesGetPnsCredentialsSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PnsCredentialsGet.json + */ + /** + * Sample code: Namespaces_GetPnsCredentials. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + namespacesGetPnsCredentials(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListAuthorizationRulesSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListAuthorizationRulesSamples.java index b6283a71e6ce..ca9837073b48 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListAuthorizationRulesSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListAuthorizationRulesSamples.java @@ -4,20 +4,22 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces ListAuthorizationRules. */ +/** + * Samples for Namespaces ListAuthorizationRules. + */ public final class NamespacesListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleList.json */ /** - * Sample code: NameSpaceAuthorizationRuleListAll. - * + * Sample code: Namespaces_ListAuthorizationRules. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleListAll( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().listAuthorizationRules("5ktrial", "nh-sdk-ns", Context.NONE); + public static void + namespacesListAuthorizationRules(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listAuthorizationRules("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupSamples.java index 8ebf2c8ae78c..b7e8f30d87ee 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces ListByResourceGroup. */ +/** + * Samples for Namespaces ListByResourceGroup. + */ public final class NamespacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/ListByResourceGroup.json */ /** - * Sample code: NameSpaceListByResourceGroup. - * + * Sample code: Namespaces_List. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceListByResourceGroup( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().listByResourceGroup("5ktrial", Context.NONE); + public static void namespacesList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listByResourceGroup("5ktrial", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListKeysSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListKeysSamples.java index 93341e9eef6e..53e838e73a98 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListKeysSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListKeysSamples.java @@ -4,20 +4,22 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces ListKeys. */ +/** + * Samples for Namespaces ListKeys. + */ public final class NamespacesListKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleListKeys.json */ /** - * Sample code: NameSpaceAuthorizationRuleListKey. - * + * Sample code: Namespaces_ListKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleListKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().listKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", Context.NONE); + public static void namespacesListKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListSamples.java index 71829aab87c2..2dd84cfa60ee 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Namespaces List. */ +/** + * Samples for Namespaces List. + */ public final class NamespacesListSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/ListBySubscription.json */ /** - * Sample code: NameSpaceList. - * + * Sample code: Namespaces_ListAll. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.namespaces().list(Context.NONE); + public static void namespacesListAll(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().list(null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesPatchSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesPatchSamples.java deleted file mode 100644 index 4f1599d98142..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesPatchSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Namespaces Patch. */ -public final class NamespacesPatchSamples { - /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json - */ - /** - * Sample code: NameSpaceUpdate. - * - * @param manager Entry point to NotificationHubsManager. - */ - public static void nameSpaceUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - NamespaceResource resource = - manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) - .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/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesRegenerateKeysSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesRegenerateKeysSamples.java index db77f78fa737..ad0db8a73e0f 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesRegenerateKeysSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesRegenerateKeysSamples.java @@ -4,28 +4,26 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyType; -/** Samples for Namespaces RegenerateKeys. */ +/** + * Samples for Namespaces RegenerateKeys. + */ public final class NamespacesRegenerateKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/AuthorizationRuleRegenerateKey.json */ /** - * Sample code: NameSpaceAuthorizationRuleRegenerateKey. - * + * Sample code: Namespaces_RegenerateKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void nameSpaceAuthorizationRuleRegenerateKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .namespaces() - .regenerateKeysWithResponse( - "5ktrial", - "nh-sdk-ns", - "RootManageSharedAccessKey", - new PolicykeyResource().withPolicyKey("PrimaryKey"), - Context.NONE); + public static void + namespacesRegenerateKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", + new PolicyKeyResource().withPolicyKey(PolicyKeyType.PRIMARY_KEY), com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesUpdateSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesUpdateSamples.java new file mode 100644 index 000000000000..39cfc8772b02 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; +import com.azure.resourcemanager.notificationhubs.models.GcmCredentialProperties; +import com.azure.resourcemanager.notificationhubs.models.NamespaceProperties; +import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentials; +import com.azure.resourcemanager.notificationhubs.models.Sku; +import com.azure.resourcemanager.notificationhubs.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Namespaces Update. + */ +public final class NamespacesUpdateSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/Update.json + */ + /** + * Sample code: Namespaces_Update. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void namespacesUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + NamespaceResource resource = manager.namespaces() + .getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value3")).withSku(new Sku().withName(SkuName.FREE)) + .withProperties(new NamespaceProperties().withPnsCredentials( + new PnsCredentials().withGcmCredential(new GcmCredential().withProperties(new GcmCredentialProperties() + .withGcmEndpoint("https://fcm.googleapis.com/fcm/send").withGoogleApiKey("fakeTokenPlaceholder"))))) + .apply(); + } + + // Use "Map.of" if available + @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/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilitySamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilitySamples.java index 2d9513c4895b..e04cd067e7b0 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilitySamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilitySamples.java @@ -4,27 +4,26 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; -/** Samples for NotificationHubs CheckNotificationHubAvailability. */ +/** + * Samples for NotificationHubs CheckNotificationHubAvailability. + */ public final class NotificationHubsCheckNotificationHubAvailabilitySamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/CheckAvailability.json */ /** - * Sample code: notificationHubCheckNameAvailability. - * + * Sample code: NotificationHubs_CheckNotificationHubAvailability. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubCheckNameAvailability( + public static void notificationHubsCheckNotificationHubAvailability( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .checkNotificationHubAvailabilityWithResponse( - "5ktrial", - "locp-newns", - new CheckAvailabilityParameters().withName("sdktest").withLocation("West Europe"), - Context.NONE); + manager.notificationHubs().checkNotificationHubAvailabilityWithResponse("5ktrial", "locp-newns", + new CheckAvailabilityParameters().withName("sdktest").withLocation("West Europe"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateAuthorizationRuleSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateAuthorizationRuleSamples.java index 0cfdfee7dee3..46fb4f9ab4e8 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateAuthorizationRuleSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateAuthorizationRuleSamples.java @@ -4,35 +4,30 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.models.AccessRights; -import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.models.SharedAccessAuthorizationRuleProperties; import java.util.Arrays; -/** Samples for NotificationHubs CreateOrUpdateAuthorizationRule. */ +/** + * Samples for NotificationHubs CreateOrUpdateAuthorizationRule. + */ public final class NotificationHubsCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleCreateOrUpdate.json */ /** - * Sample code: NotificationHubAuthorizationRuleCreate. - * + * Sample code: NotificationHubs_CreateOrUpdateAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleCreate( + public static void notificationHubsCreateOrUpdateAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .createOrUpdateAuthorizationRuleWithResponse( - "5ktrial", - "nh-sdk-ns", - "nh-sdk-hub", - "DefaultListenSharedAccessSignature", - new SharedAccessAuthorizationRuleCreateOrUpdateParameters() - .withProperties( - new SharedAccessAuthorizationRuleProperties() - .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))), - Context.NONE); + manager.notificationHubs().defineAuthorizationRule("MyManageSharedAccessKey") + .withExistingNotificationHub("5ktrial", "nh-sdk-ns", "nh-sdk-hub") + .withProperties(new SharedAccessAuthorizationRuleProperties() + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND))) + .create(); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateSamples.java index c3886cf7fe42..f3c7053b4071 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateSamples.java @@ -4,23 +4,25 @@ package com.azure.resourcemanager.notificationhubs.generated; -/** Samples for NotificationHubs CreateOrUpdate. */ +import com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties; + +/** + * Samples for NotificationHubs CreateOrUpdate. + */ public final class NotificationHubsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/CreateOrUpdate.json */ /** - * Sample code: NotificationHubCreate. - * + * Sample code: NotificationHubs_CreateOrUpdate. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubCreate( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .define("nh-sdk-hub") - .withRegion("eastus") - .withExistingNamespace("5ktrial", "nh-sdk-ns") - .create(); + public static void + notificationHubsCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().define("nh-sdk-hub").withRegion("eastus") + .withExistingNamespace("5ktrial", "nh-sdk-ns").withProperties(new NotificationHubProperties()).create(); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendSamples.java index 1f8cfae5c86f..0849ac11fc48 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendSamples.java @@ -4,32 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** Samples for NotificationHubs DebugSend. */ +/** + * Samples for NotificationHubs DebugSend. + */ public final class NotificationHubsDebugSendSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/DebugSend.json */ /** - * Sample code: debugsend. - * + * Sample code: NotificationHubs_DebugSend. + * * @param manager Entry point to NotificationHubsManager. */ - public static void debugsend(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) - throws IOException { - manager - .notificationHubs() - .debugSendWithResponse( - "5ktrial", - "nh-sdk-ns", - "nh-sdk-hub", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"data\":{\"message\":\"Hello\"}}", Object.class, SerializerEncoding.JSON), - Context.NONE); + public static void + notificationHubsDebugSend(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().debugSendWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleSamples.java index e46dd28a621f..fcc60452444c 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleSamples.java @@ -4,23 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs DeleteAuthorizationRule. */ +/** + * Samples for NotificationHubs DeleteAuthorizationRule. + */ public final class NotificationHubsDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleDelete.json */ /** - * Sample code: NotificationHubAuthorizationRuleDelete. - * + * Sample code: NotificationHubs_DeleteAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleDelete( + public static void notificationHubsDeleteAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .deleteAuthorizationRuleWithResponse( - "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", Context.NONE); + manager.notificationHubs().deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + "DefaultListenSharedAccessSignature", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteSamples.java index 51e801436cb9..e5a97e4343a9 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs Delete. */ +/** + * Samples for NotificationHubs Delete. + */ public final class NotificationHubsDeleteSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/Delete.json */ /** - * Sample code: NotificationHubDelete. - * + * Sample code: NotificationHubs_Delete. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubDelete( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().deleteWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + public static void + notificationHubsDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().deleteWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetAuthorizationRuleSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetAuthorizationRuleSamples.java index f853812e8649..677690253365 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetAuthorizationRuleSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetAuthorizationRuleSamples.java @@ -4,23 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs GetAuthorizationRule. */ +/** + * Samples for NotificationHubs GetAuthorizationRule. + */ public final class NotificationHubsGetAuthorizationRuleSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleGet.json */ /** - * Sample code: NotificationHubAuthorizationRuleGet. - * + * Sample code: NotificationHubs_GetAuthorizationRule. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleGet( + public static void notificationHubsGetAuthorizationRule( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .getAuthorizationRuleWithResponse( - "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", Context.NONE); + manager.notificationHubs().getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + "DefaultListenSharedAccessSignature", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetPnsCredentialsSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetPnsCredentialsSamples.java index 225519c3939e..30d594b4fdb5 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetPnsCredentialsSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetPnsCredentialsSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs GetPnsCredentials. */ +/** + * Samples for NotificationHubs GetPnsCredentials. + */ public final class NotificationHubsGetPnsCredentialsSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/PnsCredentialsGet.json */ /** - * Sample code: notificationHubPnsCredentials. - * + * Sample code: NotificationHubs_GetPnsCredentials. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubPnsCredentials( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + public static void + notificationHubsGetPnsCredentials(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetSamples.java index bea059fbe1cc..5fb37394c3e0 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsGetSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs Get. */ +/** + * Samples for NotificationHubs Get. + */ public final class NotificationHubsGetSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/Get.json */ /** - * Sample code: NotificationHubGet. - * + * Sample code: NotificationHubs_Get. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().getWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + public static void notificationHubsGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().getWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListAuthorizationRulesSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListAuthorizationRulesSamples.java index f45602fb94b8..74d88c41ce48 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListAuthorizationRulesSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListAuthorizationRulesSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs ListAuthorizationRules. */ +/** + * Samples for NotificationHubs ListAuthorizationRules. + */ public final class NotificationHubsListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleList.json */ /** - * Sample code: NotificationHubAuthorizationRuleListAll. - * + * Sample code: NotificationHubs_ListAuthorizationRules. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleListAll( + public static void notificationHubsListAuthorizationRules( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().listAuthorizationRules("5ktrial", "nh-sdk-ns", "nh-sdk-hub", Context.NONE); + manager.notificationHubs().listAuthorizationRules("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListKeysSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListKeysSamples.java index 0eed82180106..46d69b78fe36 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListKeysSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListKeysSamples.java @@ -4,22 +4,23 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs ListKeys. */ +/** + * Samples for NotificationHubs ListKeys. + */ public final class NotificationHubsListKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleListKeys.json */ /** - * Sample code: NotificationHubAuthorizationRuleListKey. - * + * Sample code: NotificationHubs_ListKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleListKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .listKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", "sdk-AuthRules-5800", Context.NONE); + public static void + notificationHubsListKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().listKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", "sdk-AuthRules-5800", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListSamples.java index 3423e56b436c..9ce4e0d8b3fd 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsListSamples.java @@ -4,20 +4,22 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for NotificationHubs List. */ +/** + * Samples for NotificationHubs List. + */ public final class NotificationHubsListSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/List.json */ /** - * Sample code: NotificationHubListByNameSpace. - * + * Sample code: NotificationHubs_List. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubListByNameSpace( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs().list("5ktrial", "nh-sdk-ns", Context.NONE); + public static void + notificationHubsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().list("5ktrial", "nh-sdk-ns", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsPatchSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsPatchSamples.java deleted file mode 100644 index fe78c5320db2..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsPatchSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.notificationhubs.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; - -/** Samples for NotificationHubs Patch. */ -public final class NotificationHubsPatchSamples { - /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json - */ - /** - * Sample code: NotificationHubPatch. - * - * @param manager Entry point to NotificationHubsManager. - */ - public static void notificationHubPatch( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - NotificationHubResource resource = - manager - .notificationHubs() - .getWithResponse("sdkresourceGroup", "nh-sdk-ns", "sdk-notificationHubs-8708", Context.NONE) - .getValue(); - resource.update().apply(); - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsRegenerateKeysSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsRegenerateKeysSamples.java index 7480cb0a3804..83fc35390550 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsRegenerateKeysSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsRegenerateKeysSamples.java @@ -4,29 +4,27 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyType; -/** Samples for NotificationHubs RegenerateKeys. */ +/** + * Samples for NotificationHubs RegenerateKeys. + */ public final class NotificationHubsRegenerateKeysSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/AuthorizationRuleRegenerateKey.json */ /** - * Sample code: NotificationHubAuthorizationRuleRegenrateKey. - * + * Sample code: NotificationHubs_RegenerateKeys. + * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleRegenrateKey( - com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager - .notificationHubs() - .regenerateKeysWithResponse( - "5ktrial", - "nh-sdk-ns", - "nh-sdk-hub", - "DefaultListenSharedAccessSignature", - new PolicykeyResource().withPolicyKey("PrimaryKey"), - Context.NONE); + public static void + notificationHubsRegenerateKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", + "DefaultListenSharedAccessSignature", new PolicyKeyResource().withPolicyKey(PolicyKeyType.PRIMARY_KEY), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsUpdateSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsUpdateSamples.java new file mode 100644 index 000000000000..a12b02ad974d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsUpdateSamples.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.notificationhubs.generated; + +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; +import com.azure.resourcemanager.notificationhubs.models.GcmCredentialProperties; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubProperties; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; + +/** + * Samples for NotificationHubs Update. + */ +public final class NotificationHubsUpdateSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NotificationHubs/Update.json + */ + /** + * Sample code: NotificationHubs_Update. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + notificationHubsUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + NotificationHubResource resource = manager.notificationHubs().getWithResponse("sdkresourceGroup", "nh-sdk-ns", + "sdk-notificationHubs-8708", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withProperties(new NotificationHubProperties().withRegistrationTtl("10675199.02:48:05.4775807") + .withGcmCredential(new GcmCredential().withProperties(new GcmCredentialProperties() + .withGcmEndpoint("https://fcm.googleapis.com/fcm/send").withGoogleApiKey("fakeTokenPlaceholder")))) + .apply(); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListSamples.java index ee887f656794..d4cca114a1c8 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListSamples.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.json + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * NHOperationsList.json */ /** - * Sample code: OperationsList. - * + * Sample code: Operations_List. + * * @param manager Entry point to NotificationHubsManager. */ public static void operationsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..d6622a2e5543 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsDeleteSamples.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.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().delete("5ktrial", "nh-sdk-ns", + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdSamples.java new file mode 100644 index 000000000000..7f9b7e601be6 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdSamples.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.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections GetGroupId. + */ +public final class PrivateEndpointConnectionsGetGroupIdSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateLinkResourceGet.json + */ + /** + * Sample code: PrivateEndpointConnections_GetGroupId. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void privateEndpointConnectionsGetGroupId( + com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().getGroupIdWithResponse("5ktrial", "nh-sdk-ns", "namespace", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..a261cf5cd686 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/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.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().getWithResponse("5ktrial", "nh-sdk-ns", + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsSamples.java new file mode 100644 index 000000000000..8094961c62ec --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsSamples.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.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections ListGroupIds. + */ +public final class PrivateEndpointConnectionsListGroupIdsSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateLinkResourceList.json + */ + /** + * Sample code: PrivateEndpointConnections_ListGroupIds. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void privateEndpointConnectionsListGroupIds( + com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().listGroupIds("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..ca931b65cadc --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListSamples.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.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionList.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().list("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateSamples.java new file mode 100644 index 000000000000..46db57fbd1c0 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateSamples.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.notificationhubs.generated; + +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Update. + */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: + * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/preview/2023-10-01-preview/examples/ + * Namespaces/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: PrivateEndpointConnections_Update. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void + privateEndpointConnectionsUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.privateEndpointConnections().update("5ktrial", "nh-sdk-ns", + "nh-sdk-ns.1fa229cd-bf3f-47f0-8c49-afb36723997e", + new PrivateEndpointConnectionResourceInner().withProperties(new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new RemotePrivateEndpointConnection()).withPrivateLinkServiceConnectionState( + new RemotePrivateLinkServiceConnectionState().withStatus(PrivateLinkConnectionStatus.APPROVED))), + com.azure.core.util.Context.NONE); + } +}